source: qesdi/geoplot/trunk/lib/geoplot/contour_plot.py @ 5610

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/qesdi/geoplot/trunk/lib/geoplot/contour_plot.py@5610
Revision 5610, 1.0 KB checked in by pnorton, 12 years ago (diff)

Modified the existing plot_base into a grid_plot class that uses the new map and grid factories.

I've also modified the plot_lat_lon, plot_national and plot_rotated to used the grid_plot as a base class.

Line 
1from geoplot.contour_plot_base import ContourPlotBase
2from geoplot.contour_drawer import ContourDrawer
3
4import logging
5
6log = logging.getLogger(__name__)
7
8class ContourPlot(ContourPlotBase):
9    '''
10    Creates a contour plot form the data stored in a netCDF file
11    '''
12    _accessableObjects = ['_contourDrawer']
13    _accessableObjects.extend(ContourPlotBase._accessableObjects)
14   
15    def __init__(self, **kwargs):
16        '''
17        Creates the contour plot
18        '''
19       
20        self._contourDrawer = ContourDrawer(**self._getArgs(kwargs, ContourDrawer.__name__))
21               
22        ContourPlotBase.__init__(self, **kwargs)
23       
24    def _drawDiagram(self, map, grid, axes):
25       
26        log.debug("grid.values.min() = %s, grid.values.max() = %s" % (grid.values.min() , grid.values.max(),))
27        norm = self._colourBar.getNormalize(dataMin=grid.values.min(), dataMax=grid.values.max())
28        cmap = self._colourBar.getColourMap()
29       
30        self._contourDrawer.draw(axes, grid, map.basemap, norm, cmap, self.fontSize)
31   
Note: See TracBrowser for help on using the repository browser.