Exemple #1
0
class dataCanvas(MplCanvas):
    def __init__(self, dialog=None, parent=None):
        self.dialog = dialog
        MplCanvas.__init__(self, parent)
        self.zfig = ZoomableFigure(self.dialog, self.ph)
        self.zfig.connect()
    def plot_figure(self, data, nAxes, current, plotType):
        self.ph.makeAxes(nAxes, current)
        xlabel = ''
        ylabel = ''
        zlabel = ''
        print 'plotting %s...'%(data.longname)
        if(plotType == 'TIME'):
            xlabel = data.timeunit
            ylabel = data.varunit
            zlabel = ''
            self.ph.timeline(data.time, data.getTimeValue(), xlabel, ylabel, data.varlabel)
        elif(plotType == 'HEIGHT'):
            xlabel = data.varunit
            ylabel = data.heightunit
            zlabel = ''
            self.ph.xzplot(data.getHeightValue(), data.height, xlabel, ylabel, data.varlabel)
        elif(plotType == 'TIMEHEIGHT'):
            xlabel = data.timeunit
            ylabel = data.heightunit
            zlabel = data.varunit
            self.ph.timeline2d(data.time, data.height, data.getTimeHeightMatrix(), xlabel, ylabel, zlabel)
        elif(plotType == 'TIMESLICE'):
            xlabel = data.varunit
            ylabel = data.heightunit
            zlabel = ''
            time = self.dialog.configDialog.time
            self.ph.xzplot(data.getTimeSlice(time), data.height, xlabel, ylabel, data.varlabel)
        else:
            print 'unknown dimensions of input'
        self.ph.setTitle(data.longname)
        self.draw()
Exemple #2
0
 def __init__(self, dialog=None, parent=None):
     self.dialog = dialog
     MplCanvas.__init__(self, parent)
     self.zfig = ZoomableFigure(self.dialog, self.ph)
     self.zfig.connect()