(self, data=None, graphtype='bar', show=True, guiopts=False,title=None)
return currfig
Re-do the plot with the current options and data
Re-do the plot with the current options and data
Re - do the plot with the current options and data
def plotCurrent(self, data=None, graphtype='bar', show=True, guiopts=False,title=None):
        """Re-do the plot with the current options and data"""
        if guiopts == True:
            self.applyOptions()
        if title != None:
            self.settitle(title)
        self.clear()
        currfig = pylab.figure(1)

        if data == None:
            try:
                data = self.currdata
            except:
                print ('no data to plot')
                return
        else:
            self.setData(data)

        seriesnames = []
        legendlines = []
        for d in self.dataseriesvars:
            seriesnames.append(d.get())

        self.graphtype = graphtype
        #do an X-Y plot, with the first list as X xals
        if self.graphtype == 'bar' or len(data) == 1:
            i=0
            pdata = copy.deepcopy(data)
            if len(pdata)>1:
                x = pdata[0]
                pdata.remove(x)
                for y in pdata:
                    if i >= len(self.colors):
                        i = 0
                    c = self.colors[i]
                    self.doBarChart(x, y, clr=c)
                    i+=1
            else:
                y = pdata[0]
                x = range(len(y))
                self.doBarChart(x, y, clr='b')

        elif self.graphtype == 'XY':
            pdata = copy.deepcopy(data)
            x = pdata[0]
            pdata.remove(x)
            i=0
            for y in pdata:
                if i >= len(self.colors):
                    i = 0
                c = self.colors[i]
                line = self.plotXY(x, y, clr=c, lw=self.linewidth)
                legendlines.append(line)
                i+=1

        elif self.graphtype == 'hist':
            self.doHistogram(data)
        elif self.graphtype == 'pie':
            self.doPieChart(data)

        pylab.title(self.plottitle)
        pylab.xlabel(self.plotxlabel)
        pylab.ylabel(self.plotylabel)
        #create legend data
        if self.showlegend == 1:
            pylab.legend(legendlines,seriesnames,
                         loc=self.legendloc)
        if self.grid == 1:
            pylab.grid(True)

        if show == True:
            self.show()
        return currfig
def plotCurrent ( self , data = None , graphtype = 'bar' , show = True , guiopts = False , title = None ) : if guiopts == True : self . applyOptions ( ) if title != None : self . settitle ( title ) self . clear ( ) currfig = pylab . figure ( 1 ) if data == None : try : data = self . currdata except : print ( 'no data to plot' ) return else : self . setData ( data ) seriesnames = [ ] legendlines = [ ] for d in self . dataseriesvars : seriesnames . append ( d . get ( ) ) self . graphtype = graphtype #do an X-Y plot, with the first list as X xals if self . graphtype == 'bar' or len ( data ) == 1 : i = 0 pdata = copy . deepcopy ( data ) if len ( pdata ) > 1 : x = pdata [ 0 ] pdata . remove ( x ) for y in pdata : if i >= len ( self . colors ) : i = 0 c = self . colors [ i ] self . doBarChart ( x , y , clr = c ) i += 1 else : y = pdata [ 0 ] x = range ( len ( y ) ) self . doBarChart ( x , y , clr = 'b' ) elif self . graphtype == 'XY' : pdata = copy . deepcopy ( data ) x = pdata [ 0 ] pdata . remove ( x ) i = 0 for y in pdata : if i >= len ( self . colors ) : i = 0 c = self . colors [ i ] line = self . plotXY ( x , y , clr = c , lw = self . linewidth ) legendlines . append ( line ) i += 1 elif self . graphtype == 'hist' : self . doHistogram ( data ) elif self . graphtype == 'pie' : self . doPieChart ( data ) pylab . title ( self . plottitle ) pylab . xlabel ( self . plotxlabel ) pylab . ylabel ( self . plotylabel ) #create legend data if self . showlegend == 1 : pylab . legend ( legendlines , seriesnames , loc = self . legendloc ) if self . grid == 1 : pylab . grid ( True ) if show == True : self . show ( ) return currfig