Changeset 6319 for qesdi


Ignore:
Timestamp:
18/01/10 11:28:34 (9 years ago)
Author:
pnorton
Message:

Enabled plotting against an axis of named values as well as numeric values.

Location:
qesdi/graphplotter/trunk/graphplotter/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • qesdi/graphplotter/trunk/graphplotter/lib/data_reader.py

    r6313 r6319  
    117117         
    118118        #get the x-data from the named axis 
    119         xdata = var.getAxis(var.getAxisIndex(axis))[:] 
     119        xdata = self.getAxisValues(var.id, axis) 
    120120         
    121121        return xdata, ydata 
  • qesdi/graphplotter/trunk/graphplotter/lib/plot_builder.py

    r6313 r6319  
    3131        selection = self._buildSelection() 
    3232         
     33        log.debug("selection = %s" % (selection,)) 
    3334         
    3435        reader = DataReader(self.config['path'], self.config['axisLookup']) 
     
    4243        plt = Plot() 
    4344         
    44         plt.draw(xdata, ydata) 
     45        plt.setYLabel(self.params['variable']) 
     46        plt.setXLabel(self.params['axis']) 
     47         
     48        lineName = self._getLineName(selection) 
     49         
     50        plt.draw(xdata, ydata, label=lineName) 
    4551         
    4652        return plt.getImage() 
     
    5460         
    5561        return sel 
     62     
     63    def _getLineName(self, selection): 
     64         
     65        name = "" 
     66         
     67        for k in sorted(selection.keys()): 
     68            name = name + "%s=%s, " % (k, selection[k]) 
     69         
     70        name = name[:-2] 
     71        return name 
Note: See TracChangeset for help on using the changeset viewer.