i writing program imports data files , plots data. plots added , removed user using buttons in traits-based ui. have of working, add tool allows user select line on plot perform actions on (change color, remove, etc.). examples can find selecting individual points on scatter plot.
sometimes plots overlap 1 closely, envisioned solution on mouseover, lineplot highlight in way (line width expands data set). if user clicks line, need feedback plot selected (name or index of plot example) can allow actions performed on selection. here part of code generate plot:
#------------------------------- # generate chaco plot list of data def generateplot(self): #turn data list arrayplotdata plotdata = arrayplotdata() in range(len(self.datalist)): plotdata.set_data('x' + str(i), self.datalist[i][0]) plotdata.set_data('y' + str(i), self.datalist[i][1]) #add plots of each arrayplotdata set dataplot = plot(plotdata) in range(len(self.datalist)): renderer = dataplot.plot(('x' + str(i), 'y' + str(i)), color=getcolor(i), line_width=2, name=self.labellist[i])[0] #format plot dataplot.value_scale = 'log' dataplot.title = 'iv curve comparison' dataplot.x_axis.title = 'bias (v)' dataplot.y_axis.title = 'current (a/cm' + u"\u00b2" + ')' dataplot.y_axis.tick_label_formatter = lambda val: floattostring(val) dataplot.padding_left = 100 #legend dataplot.legend.visible = true dataplot.legend.align = 'lr' dataplot.legend.labels = self.labellist dataplot.legend.tools.append(legendtool(dataplot.legend, drag_button='left')) self.dataplot = dataplot here image of interface @ point imported data plotted give idea i'm trying do: http://i.stack.imgur.com/einry.png
Comments
Post a Comment