From fd9d1d37048e40b9fb77a8867f20d5d79a680718 Mon Sep 17 00:00:00 2001 From: sfop Date: Fri, 17 Jun 2016 11:09:35 +0200 Subject: [PATCH] Script execution --- script/test/MultiplePlot.py | 40 ------------------------------------- 1 file changed, 40 deletions(-) diff --git a/script/test/MultiplePlot.py b/script/test/MultiplePlot.py index f6178ac..4da5bae 100644 --- a/script/test/MultiplePlot.py +++ b/script/test/MultiplePlot.py @@ -1,44 +1,4 @@ import random - - -def clear_convex_hull_plot(title): - plots = get_plots(title = title) - if len(plots)>0: - plots[0].clear() - - -def add_convex_hull_plot(title, x,y, name=None, clear = False): - plots = get_plots(title = title) - p = None - if len(plots)==0: - p = plot(None,name=name, title = title)[0] - p.getAxis(p.AxisId.X).setRange(-50,150) - p.getAxis(p.AxisId.Y).setRange(-50,150) - p.setLegendVisible(True) - else: - p = plots[0] - if clear: - p.clear() - p.addSeries(LinePlotSeries(name)) - s = p.getSeries(name) - s.setLinesVisible(False) - s.setPointSize(3) - s.setData(x, y) - - #Convex Hull - #In the first time the plot shows, it takes some time for the color to be assigned - while s.color is None: - time.sleep(0.001) - hull = LinePlotSeries(name + " Hull", s.color) - p.addSeries(hull) - #Bounding box - #x1,x2,y1,y2 = min(x), max(x), min(y), max(y) - #(hx,hy) = ([x1,x2, x2, x1, x1], [y1, y1, y2, y2, y1]) - (hx,hy) = convex_hull(x=x, y=y) - hx.append(hx[0]); hy.append(hy[0]) - hull.setLineWidth(2) - hull.setData(hx,hy) - hull.setColor(s.color) clear_convex_hull_plot("test")