Changeset 6024


Ignore:
Timestamp:
19/11/09 12:07:55 (10 years ago)
Author:
pnorton
Message:

Modified the cairo renderer to work with the latest matplotlib version.

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

Legend:

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

    r5760 r6024  
    88 
    99from matplotlib.backends.backend_cairo import RendererCairo, FigureCanvasCairo, cairo, Affine2D 
    10  
     10import matplotlib 
    1111import logging 
    1212 
     
    2323         
    2424        ctx = gc.ctx 
    25         ctx.save() 
    26         self._do_clip(ctx, gc._cliprect, gc._clippath) 
    27  
     25         
    2826        transform = transform + \ 
    2927            Affine2D().scale(1.0, -1.0).translate(0, self.height) 
    30         tpath = transform.transform_path(path) 
    3128 
    3229        ctx.new_path() 
    33         self.convert_path(ctx, tpath) 
     30        self.convert_path(ctx, path, transform) 
    3431 
    3532        self._fill_and_stroke(ctx, rgbFace, gc.get_alpha()) 
    36         ctx.restore() 
    3733         
    3834class CustomFigureCanvasCairo(FigureCanvasCairo): 
     35     
    3936    def print_png(self, fobj, *args, **kwargs): 
     37         
    4038        width, height = self.get_width_height() 
    4139 
  • qesdi/geoplot/trunk/lib/geoplot/grid_drawer.py

    r5876 r6024  
    2222import numpy.ma as MA 
    2323import geoplot.mpl_imports 
     24from matplotlib.colors import LightSource 
    2425 
    2526#internal modules 
     
    238239         
    239240        log.debug("got extent = %s yStart = %s yEnd = %s" % (extent, yStart, yEnd,)) 
     241         
     242#        ls = LightSource(azdeg=0,altdeg=65) 
     243#        rgb = ls.shade(Z,kwargs['cmap']) 
     244 
     245         
    240246         
    241247        im = axes.imshow(Z, extent=extent, 
Note: See TracChangeset for help on using the changeset viewer.