def set_color(self, color,line=None): self.color = color c = colors.hexcolor(color) if line: for l in line: l.set_color(c) l.set_markeredgecolor(c) l.set_markerfacecolor(c)
def onColor(self,event,argu='grid'): color = hexcolor( event.GetValue() ) if (argu[:6] == 'trace '): self.conf.set_trace_color(color,trace=int(argu[6:])) self.redraw_legend() elif argu == 'grid': for i in self.axes.get_xgridlines()+self.axes.get_ygridlines(): i.set_color(color) elif argu == 'bg': self.axes.set_axis_bgcolor(color) self.canvas.draw()
def set_color(self, color,line=None): self.color = color c = colors.hexcolor(color) def _setc(aline, col): aline.set_color(col) if line: for lx in line: if isinstance(lx, (list, tuple)): for sublx in lx: _setc(sublx, c) else: _setc(lx, c)
def onScatter(self, event, argu=None): if self.conf.scatter_coll is None or argu is None: return conf = self.conf coll = conf.scatter_coll recolor = True if argu == 'size': conf.scatter_size = event.GetInt() coll._sizes = (conf.scatter_size,) recolor = False elif argu == 'scatt_nf': self.conf.scatter_normalcolor = hexcolor(event.GetValue()) elif argu == 'scatt_ne': self.conf.scatter_normaledge = hexcolor(event.GetValue()) elif argu == 'scatt_sf': self.conf.scatter_selectcolor = hexcolor(event.GetValue()) elif argu == 'scatt_se': self.conf.scatter_selectedge = hexcolor(event.GetValue()) if recolor: fcols = coll.get_facecolors() ecols = coll.get_edgecolors() try: pts = np.nonzero(self.conf.scatter_mask)[0] except: pts = [] for i in range(len(conf.scatter_data)): if i in pts: ecols[i] = to_rgba(conf.scatter_selectedge) fcols[i] = to_rgba(conf.scatter_selectcolor) fcols[i][3] = 0.5 else: fcols[i] = to_rgba(conf.scatter_normalcolor) ecols[i] = to_rgba(conf.scatter_normaledge) self.canvas.draw()
def onColor(self, event, argu='grid'): color = hexcolor( event.GetValue() ) if argu[:6] == 'trace ': trace = int(argu[6:]) self.conf.set_trace_color(color,trace=trace) if hasattr(self.trace_color_callback, '__call__'): self.trace_color_callback(trace, color) self.redraw_legend() elif argu == 'grid': self.conf.grid_color = color for ax in self.axes: for i in ax.get_xgridlines()+ax.get_ygridlines(): i.set_color(color) elif argu == 'bg': for ax in self.axes: ax.set_axis_bgcolor(color) elif argu == 'fbg': self.canvas.figure.set_facecolor(color) elif argu == 'text': self.conf.textcolor = color self.conf.relabel() return self.canvas.draw()