Ignore:
Timestamp:
23/10/09 16:25:45 (10 years ago)
Author:
pnorton
Message:

Added a faster layer drawer for the grid, a new style of colour bar and colour schemes which now hold the normalisation and colour map instances.

File:
1 edited

Legend:

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

    r5826 r5876  
    44 
    55import logging 
     6import time 
    67 
    78import geoplot.utils as geoplot_utils 
     
    1415    "Draw only the layer section of the plot" 
    1516     
    16     def __init__(self, cdmsVar, gridType='latlon', showGridLines=False, cmap=None, cmapRange=(None,None), outline=False, 
    17                  transparent=False,  
    18                  intervalColourbar=False,  
    19                  bgcolour='white', 
    20                  intervalNames=None): 
     17    def __init__(self, cdmsVar, showGridLines=False, outline=False, **kwargs): 
    2118         
    2219        self._gridDrawer = GridDrawer() 
     
    2623        self.outline = outline 
    2724         
    28         LayerDrawerBase.__init__(self, gridType=gridType, transparent=transparent, cmap=cmap, cmapRange=cmapRange, bgcolour=bgcolour) 
     25        LayerDrawerBase.__init__(self, **kwargs) 
    2926         
    3027    def _drawToAxes(self, axes, xLimits, yLimits): 
     
    4441         
    4542#        map = self._getMap(xLimits, yLimits) 
    46 #        map.basemap.drawcoastlines(ax=axes, xLimits=xLimits, yLimits=yLimits)      
    47          
    48         norm = self._cb.getNormalize(grid=grid) 
    49         cmap = self._cb.getColourMap(grid=grid) 
     43#        map.basemap.drawcoastlines(ax=axes, xLimits=xLimits, yLimits=yLimits) 
    5044 
     45        scheme = self._csBuilder.buildScheme(grid) 
     46        cmap = scheme.colourMap 
    5147        #set the bad colour to transparent 
    5248        cmap.set_bad('w', 0.0) 
     
    5652                              basemap=basemap,  
    5753                              limits=(xLimits, yLimits), 
    58                               norm=norm, 
     54                              norm=scheme.norm, 
    5955                              cmap=cmap) 
    60                                
     56         
    6157     
    6258    ### properties ### 
Note: See TracChangeset for help on using the changeset viewer.