def pcolormesh(self, *args, **kwargs): kwargs = process_kwargs(self, kwargs) self.remove_collection() if len(args) == 1: #if isinstance(args[0], tuple): # self.zdata=zeros(args[0]) #else: self.zdata = asanyarray(args[0]) numRows, numCols = self.zdata.shape self.xdata = arange(numCols) self.ydata = arange(numRows) #elif len(args)==2: # args=args+(zeros((len(self.xdata)-1, len(self.ydata)-1)),) # self.xdata, self.ydata, self.zdata= [asanyarray(a) for a in args] elif len(args) == 3: self.xdata, self.ydata, self.zdata = [asanyarray(a) for a in args] if self.expand_XY: self.xdata = linspace(min(self.xdata), max(self.xdata), len(self.xdata) + 1) self.ydata = linspace(min(self.ydata), max(self.ydata), len(self.ydata) + 1) self.clt = self.plotter.axes.pcolormesh(self.xdata, self.ydata, self.zdata, **kwargs) self.do_autolim()
def add_cursor(self, x, y, **kwargs): kwargs = process_kwargs(self, kwargs) self.remove_collection() self.clt = dict(h_line=self.plotter.axes.axhline(y, **kwargs), v_line=self.plotter.axes.axvline(x, **kwargs), v_axe=self.plotter.vert_axe.axhline(y, **kwargs), h_axe=self.plotter.horiz_axe.axvline(x, **kwargs))
def add_cursor(self, x, y, **kwargs): kwargs=process_kwargs(self, kwargs) self.remove_collection() self.clt=dict(h_line=self.plotter.axes.axhline(y, **kwargs), v_line=self.plotter.axes.axvline(x, **kwargs), v_axe=self.plotter.vert_axe.axhline(y, **kwargs), h_axe=self.plotter.horiz_axe.axvline(x, **kwargs))
def polygon_plot(self, *args, **kwargs): kwargs=process_kwargs(self, kwargs) #self.xdata=[arg[0] for arg in args[0][0]] #self.zdata=[[vert[1] for vert in line] for line in args[0]] self.clt=PolyCollection(args[0], alpha=self.alpha, antialiased=self.antialiased) self.clt.set_color(self.color) #from matplotlib.colors import colorConverter colorConverter.to_rgba( self.plotter.axes.add_collection(self.clt)
def polygon_plot(self, *args, **kwargs): kwargs = process_kwargs(self, kwargs) #self.xdata=[arg[0] for arg in args[0][0]] #self.zdata=[[vert[1] for vert in line] for line in args[0]] self.clt = PolyCollection(args[0], alpha=self.alpha, antialiased=self.antialiased) self.clt.set_color( self.color ) #from matplotlib.colors import colorConverter colorConverter.to_rgba( self.plotter.axes.add_collection(self.clt)
def scatter_plot(self, *args, **kwargs): kwargs = process_kwargs(self, kwargs) self.remove_collection() if len(args) == 1: self.ydata = args[0] self.xdata = arange(len(self.ydata)) elif len(args) == 2: self.xdata = args[0] self.ydata = args[1] self.clt = self.plotter.axes.scatter(self.xdata, self.ydata, **kwargs) self.do_autolim()
def scatter_plot(self, *args, **kwargs): kwargs=process_kwargs(self, kwargs) self.remove_collection() if len(args)==1: self.ydata=args[0] self.xdata=arange(len(self.ydata)) elif len(args)==2: self.xdata=args[0] self.ydata=args[1] self.clt=self.plotter.axes.scatter(self.xdata, self.ydata, **kwargs) self.do_autolim()
def line_plot(self, *args, **kwargs): kwargs = process_kwargs(self, kwargs) self.remove_collection() if len(args) == 1: y = args[0] x = arange(len(y)) elif len(args) == 2: x = args[0] y = args[1] self.xdata = array(x) self.ydata = array(y) self.clt = self.plotter.axes.plot(*args, **kwargs)[0] self.do_autolim()
def line_plot(self, *args, **kwargs): kwargs=process_kwargs(self, kwargs) self.remove_collection() if len(args)==1: y=args[0] x=arange(len(y)) elif len(args)==2: x=args[0] y=args[1] self.xdata=array(x) self.ydata=array(y) self.clt=self.plotter.axes.plot(*args, **kwargs)[0] self.do_autolim()
def pcolormesh(self, *args, **kwargs): kwargs=process_kwargs(self, kwargs) self.remove_collection() if len(args) == 1: #if isinstance(args[0], tuple): # self.zdata=zeros(args[0]) #else: self.zdata=asanyarray(args[0]) numRows, numCols = self.zdata.shape self.xdata=arange(numCols) self.ydata=arange(numRows) #elif len(args)==2: # args=args+(zeros((len(self.xdata)-1, len(self.ydata)-1)),) # self.xdata, self.ydata, self.zdata= [asanyarray(a) for a in args] elif len(args) == 3: self.xdata, self.ydata, self.zdata = [asanyarray(a) for a in args] if self.expand_XY: self.xdata=linspace(min(self.xdata), max(self.xdata), len(self.xdata)+1) self.ydata=linspace(min(self.ydata), max(self.ydata), len(self.ydata)+1) self.clt=self.plotter.axes.pcolormesh(self.xdata, self.ydata, self.zdata, **kwargs) self.do_autolim()
def multiline_plot(self, *args, **kwargs): kwargs = process_kwargs(self, kwargs) self.xdata = [arg[0] for arg in args[0][0]] self.zdata = [[vert[1] for vert in line] for line in args[0]] self.clt = LineCollection(args[0]) self.plotter.axes.add_collection(self.clt)
def axhline(self, y, **kwargs): kwargs = process_kwargs(self, kwargs) self.remove_collection() self.clt = self.plotter.axes.axhline(y, **kwargs)
def multiline_plot(self, *args, **kwargs): kwargs=process_kwargs(self, kwargs) self.xdata=[arg[0] for arg in args[0][0]] self.zdata=[[vert[1] for vert in line] for line in args[0]] self.clt=LineCollection(args[0]) self.plotter.axes.add_collection(self.clt)
def axhline(self, y, **kwargs): kwargs=process_kwargs(self, kwargs) self.remove_collection() self.clt=self.plotter.axes.axhline(y, **kwargs)