def plot(self, *args, **kwds): axis = kwds.pop('axis', None) if axis is None: axis = plotbackend.gca() tmp = None plotflag = kwds.get('plotflag', None) if not plotflag and self.children != None: plotbackend.hold('on') tmp = [] child_args = kwds.pop( 'plot_args_children', tuple(self.plot_args_children)) child_kwds = dict(self.plot_kwds_children).copy() child_kwds.update(kwds.pop('plot_kwds_children', {})) child_kwds['axis'] = axis for child in self.children: tmp1 = child.plot(*child_args, **child_kwds) if tmp1 != None: tmp.append(tmp1) if len(tmp) == 0: tmp = None main_args = args if len(args) else tuple(self.plot_args) main_kwds = dict(self.plot_kwds).copy() main_kwds.update(kwds) main_kwds['axis'] = axis tmp2 = self.plotter.plot(self, *main_args, **main_kwds) return tmp2, tmp
def plot(self, *args, **kwds): axis = kwds.pop('axis', None) if axis is None: axis = plotbackend.gca() tmp = None plotflag = kwds.get('plotflag', None) if not plotflag and self.children is not None: plotbackend.hold('on') tmp = [] child_args = kwds.pop('plot_args_children', tuple(self.plot_args_children)) child_kwds = dict(self.plot_kwds_children).copy() child_kwds.update(kwds.pop('plot_kwds_children', {})) child_kwds['axis'] = axis for child in self.children: tmp1 = child.plot(*child_args, **child_kwds) if tmp1 is not None: tmp.append(tmp1) if len(tmp) == 0: tmp = None main_args = args if len(args) else tuple(self.plot_args) main_kwds = dict(self.plot_kwds).copy() main_kwds.update(kwds) main_kwds['axis'] = axis tmp2 = self.plotter.plot(self, *main_args, **main_kwds) return tmp2, tmp
def labelfig(self, axis=None): if axis is None: axis = plotbackend.gca() try: h1 = axis.set_title(self.title) h2 = axis.set_xlabel(self.xlab) h3 = axis.set_ylabel(self.ylab) #h4 = plotbackend.zlabel(self.zlab) return h1, h2, h3 except: pass
def labelfig(self, axis=None): if axis is None: axis = plotbackend.gca() try: h1 = axis.set_title(self.title) h2 = axis.set_xlabel(self.xlab) h3 = axis.set_ylabel(self.ylab) # h4 = plotbackend.zlabel(self.zlab) return h1, h2, h3 except: pass
def labelfig(self, axis=None): if axis is None: axis = plotbackend.gca() try: h = [] for fun, txt in zip(('set_title', 'set_xlabel','set_ylabel', 'set_ylabel'), (self.title,self.xlab,self.ylab, self.zlab)): if txt: if fun.startswith('set_title'): title0 = axis.get_title() txt = title0 +'\n' + txt h.append(getattr(axis, fun)(txt)) return h except: pass
def labelfig(self, axis=None): if axis is None: axis = plotbackend.gca() try: h = [] for fun, txt in zip( ('set_title', 'set_xlabel', 'set_ylabel', 'set_ylabel'), (self.title, self.xlab, self.ylab, self.zlab)): if txt: if fun.startswith('set_title'): title0 = axis.get_title() if title0.lower().strip() != txt.lower().strip(): txt = title0 + '\n' + txt h.append(getattr(axis, fun)(txt)) return h except: pass
def plot(self, wdata, *args, **kwds): axis = kwds.pop('axis', None) if axis is None: axis = plotbackend.gca() plotflag = kwds.pop('plotflag', False) if plotflag: h1 = self._plot(axis, plotflag, wdata, *args, **kwds) else: if isinstance(wdata.data, (list, tuple)): vals = tuple(wdata.data) else: vals = (wdata.data,) if isinstance(wdata.args, (list, tuple)): args1 = tuple((wdata.args)) + vals + args else: args1 = tuple((wdata.args,)) + vals + args plotfun = getattr(axis, self.plotmethod) h1 = plotfun(*args1, **kwds) h2 = wdata.labels.labelfig(axis) return h1, h2
def plot(self, wdata, *args, **kwds): axis = kwds.pop('axis', None) if axis is None: axis = plotbackend.gca() plotflag = kwds.pop('plotflag', False) if plotflag: h1 = self._plot(axis, plotflag, wdata, *args, **kwds) else: if isinstance(wdata.data, (list, tuple)): vals = tuple(wdata.data) else: vals = (wdata.data, ) if isinstance(wdata.args, (list, tuple)): args1 = tuple((wdata.args)) + vals + args else: args1 = tuple((wdata.args, )) + vals + args plotfun = getattr(axis, self.plotmethod) h1 = plotfun(*args1, **kwds) h2 = wdata.labels.labelfig(axis) return h1, h2