Files
sf-op/script/test/MultiplePlot.py
2016-06-16 16:56:45 +02:00

32 lines
610 B
Python

import random
title = "test"
p = None
def add_plot(x,y, name=None):
global title
global p
plots = get_plots(title = title)
if len(plots)==0:
p = plot(None,name="Data 1")[0]
p.setLegendVisible(True)
else:
p = plots[0]
p.addSeries(LinePlotSeries(name))
s = p.getSeries(name)
s.setData(x, y)
x=[]
y=[]
for step in range(1,2):
x=[]
y=[]
for i in range(100):
x.append(random.random() * 100 / step)
y.append(random.random() * 100/ step)
add_plot (x,y,"Step " + str(step))