Ignore:
Timestamp:
04/12/09 16:07:45 (11 years ago)
Author:
pnorton
Message:

Imroved the colour bar code so that a legend colour bar can be used without specifying any intervals.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • qesdi/geoplot/trunk/lib/geoplot/layer_drawer_grid.py

    r5876 r6089  
    1515    "Draw only the layer section of the plot" 
    1616     
    17     def __init__(self, cdmsVar, showGridLines=False, outline=False, **kwargs): 
     17    def __init__(self, cdmsVar, showGridLines=False, outline=False, 
     18                 hideOutside=False,  
     19                 numIntervals = None, **kwargs): 
     20         
     21        self.numIntervals = numIntervals 
     22        self.hideOutside = hideOutside 
     23         
    1824         
    1925        self._gridDrawer = GridDrawer() 
     
    4349#        map.basemap.drawcoastlines(ax=axes, xLimits=xLimits, yLimits=yLimits) 
    4450 
    45         scheme = self._csBuilder.buildScheme(grid) 
     51        scheme = self._csBuilder.buildScheme(self.colourBarStyle, grid=grid) 
    4652        cmap = scheme.colourMap 
    4753        #set the bad colour to transparent 
    4854        cmap.set_bad('w', 0.0) 
     55         
     56        self._applyMask(grid, scheme, self.hideOutside) 
    4957         
    5058        #draw the grid on the axis 
     
    7381     
    7482    outline = property(__get_outline, __set_outline) 
    75   
     83 
     84    def __set_numIntervals(self, value): 
     85        self._csBuilder.numIntervals = value 
     86 
     87    def __get_numIntervals(self): 
     88        return self._csBuilder.numIntervals 
     89         
     90    numIntervals = property(__get_numIntervals, __set_numIntervals, None, None)  
     91     
     92    def __set_hideOutside(self, value): 
     93        self._hideOutsideBounds = value 
     94 
     95    def __get_hideOutside(self): 
     96        return self._hideOutsideBounds 
     97         
     98    hideOutside = property(__get_hideOutside, __set_hideOutside, None, None) 
Note: See TracChangeset for help on using the changeset viewer.