Ignore:
Timestamp:
07/09/09 12:52:39 (11 years ago)
Author:
pnorton
Message:

Improved the colour bar code so it now accepts the data array instead of just a minimum + maximum. It also now defaults to creating a Normalize instance with vmin=None and vmax=None instead of 0 and 1.

Also modified the layer_drawer objects to use the ColourBar? class instead of implementing it themselves.

File:
1 edited

Legend:

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

    r5636 r5688  
    2222import geoplot.utils as geoplot_utils 
    2323 
     24from geoplot.colour_bar import ColourBar 
     25 
    2426log = logging.getLogger(__name__) 
    2527 
     
    3537                 transparent=False, 
    3638                 projection='latlon', 
    37                  resolution='c'): 
    38          
     39                 resolution=None, 
     40                 cmap=None,  
     41                 cmapRange=(None,None), ): 
     42         
     43        self._cb = ColourBar() 
    3944        self.transparent = transparent 
    40         #self.gridType = gridType 
     45        self.cmap = cmap 
     46        self.cmapRange = cmapRange 
    4147         
    4248        self._gridFactory = GridFactory(dataType=gridType) 
     
    209215    def __get_projection(self): 
    210216        return self._mapFactory.projection 
    211      
     217 
     218    def __set_cmap(self, value): 
     219        self._cb.cmap = value 
     220         
     221    def __get_cmap(self): 
     222        return self._cb.cmap  
     223     
     224    cmap = property(__get_cmap, __set_cmap) 
     225     
     226    def __set_cmapRange(self, value): 
     227        self._cb.colourBarMin = value[0] 
     228        self._cb.colourBarMax = value[1] 
     229         
     230    def __get_cmapRange(self): 
     231        return (self._cb.colourBarMin, self._cb.colourBarMax) 
     232     
     233    cmapRange = property(__get_cmapRange, __set_cmapRange) 
     234     
     235 
    212236    projection = property(__get_projection, __set_projection, None, None) 
    213237     
Note: See TracChangeset for help on using the changeset viewer.