Revision: 6937
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6937&view=rev
Author:   jouni
Date:     2009-02-26 19:44:30 +0000 (Thu, 26 Feb 2009)

Log Message:
-----------
Support image clipping in the pdf backend

Modified Paths:
--------------
    trunk/matplotlib/CHANGELOG
    trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py

Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG  2009-02-26 00:12:33 UTC (rev 6936)
+++ trunk/matplotlib/CHANGELOG  2009-02-26 19:44:30 UTC (rev 6937)
@@ -1,3 +1,5 @@
+2009-02-26 Support image clipping in pdf backend. - JKS
+
 2009-02-25 Improve tick location subset choice in FixedLocator. - EF
 
 2009-02-24 Deprecate numerix, and strip out all but the numpy

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py     2009-02-26 
00:12:33 UTC (rev 6936)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py     2009-02-26 
19:44:30 UTC (rev 6937)
@@ -39,7 +39,7 @@
 from matplotlib.ft2font import FT2Font, FIXED_WIDTH, ITALIC, LOAD_NO_SCALE, \
     LOAD_NO_HINTING, KERNING_UNFITTED
 from matplotlib.mathtext import MathTextParser
-from matplotlib.transforms import Affine2D, Bbox, BboxBase
+from matplotlib.transforms import Affine2D, Bbox, BboxBase, TransformedPath
 from matplotlib.path import Path
 from matplotlib import ttconv
 
@@ -1268,10 +1268,12 @@
         return self.image_dpi/72.0
 
     def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None):
-        # MGDTODO: Support clippath here
         gc = self.new_gc()
         if bbox is not None:
             gc.set_clip_rectangle(bbox)
+        if clippath is not None:
+            clippath = TransformedPath(clippath, clippath_trans)
+            gc.set_clip_path(clippath)
         self.check_gc(gc)
 
         h, w = im.get_size_out()


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to