From: <jd...@us...> - 2008-06-20 14:06:33
|
Revision: 5611 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5611&view=rev Author: jdh2358 Date: 2008-06-20 07:05:42 -0700 (Fri, 20 Jun 2008) Log Message: ----------- fixed pixel border bug for composite images (eg layer_image.py) Modified Paths: -------------- trunk/matplotlib/MANIFEST.in trunk/matplotlib/examples/api/mathtext_asarray.py trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/figure.py Added Paths: ----------- trunk/matplotlib/examples/widgets/README.txt Removed Paths: ------------- trunk/matplotlib/examples/widgets/README Modified: trunk/matplotlib/MANIFEST.in =================================================================== --- trunk/matplotlib/MANIFEST.in 2008-06-20 13:30:18 UTC (rev 5610) +++ trunk/matplotlib/MANIFEST.in 2008-06-20 14:05:42 UTC (rev 5611) @@ -14,8 +14,8 @@ include lib/matplotlib/mpl-data/fonts/pdfcorefonts/* include lib/matplotlib/mpl-data/fonts/afm/* recursive-include license LICENSE* -recursive-include examples README *.py -prune examples/_tmp_* +recursive-include examples * +recursive-include doc * recursive-include src *.cpp *.c *.h recursive-include CXX *.cxx *.hxx *.c *.h recursive-include agg24 * Modified: trunk/matplotlib/examples/api/mathtext_asarray.py =================================================================== --- trunk/matplotlib/examples/api/mathtext_asarray.py 2008-06-20 13:30:18 UTC (rev 5610) +++ trunk/matplotlib/examples/api/mathtext_asarray.py 2008-06-20 14:05:42 UTC (rev 5611) @@ -5,15 +5,20 @@ import numpy as np import matplotlib.mathtext as mathtext import matplotlib.pyplot as plt +import matplotlib +matplotlib.rc('image', origin='upper') parser = mathtext.MathTextParser("Bitmap") parser.to_png('test2.png', r'$\left[\left\lfloor\frac{5}{\frac{\left(3\right)}{4}} y\right)\right]$', color='green', fontsize=14, dpi=100) -rgba = parser.to_rgba(r'IQ: $\sigma_i=15$', color='blue', fontsize=20, dpi=200) +rgba1, depth1 = parser.to_rgba(r'IQ: $\sigma_i=15$', color='blue', fontsize=20, dpi=200) +rgba2, depth2 = parser.to_rgba(r'some other string', color='red', fontsize=20, dpi=200) fig = plt.figure() -fig.figimage(rgba.astype(float)/255., 100, 100) +fig.figimage(rgba1.astype(float)/255., 100, 100) +fig.figimage(rgba2.astype(float)/255., 100, 300) + plt.show() Deleted: trunk/matplotlib/examples/widgets/README =================================================================== --- trunk/matplotlib/examples/widgets/README 2008-06-20 13:30:18 UTC (rev 5610) +++ trunk/matplotlib/examples/widgets/README 2008-06-20 14:05:42 UTC (rev 5611) @@ -1,2 +0,0 @@ -Examples of how to write primitive, but GUI agnoistic, widgets in -matplotlib Copied: trunk/matplotlib/examples/widgets/README.txt (from rev 5596, trunk/matplotlib/examples/widgets/README) =================================================================== --- trunk/matplotlib/examples/widgets/README.txt (rev 0) +++ trunk/matplotlib/examples/widgets/README.txt 2008-06-20 14:05:42 UTC (rev 5611) @@ -0,0 +1,2 @@ +Examples of how to write primitive, but GUI agnoistic, widgets in +matplotlib Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-06-20 13:30:18 UTC (rev 5610) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-06-20 14:05:42 UTC (rev 5611) @@ -1436,15 +1436,18 @@ for im in self.images if im.get_visible()] - im = mimage.from_images(self.bbox.height*mag, - self.bbox.width*mag, + l, b, r, t = self.bbox.extents + width = mag*((round(r) + 0.5) - (round(l) - 0.5)) + height = mag*((round(t) + 0.5) - (round(b) - 0.5)) + im = mimage.from_images(height, + width, ims) im.is_grayscale = False l, b, w, h = self.bbox.bounds # composite images need special args so they will not # respect z-order for now renderer.draw_image( - l, b, im, self.bbox, + round(l), round(b), im, self.bbox, self.axesPatch.get_path(), self.axesPatch.get_transform()) Modified: trunk/matplotlib/lib/matplotlib/figure.py =================================================================== --- trunk/matplotlib/lib/matplotlib/figure.py 2008-06-20 13:30:18 UTC (rev 5610) +++ trunk/matplotlib/lib/matplotlib/figure.py 2008-06-20 14:05:42 UTC (rev 5611) @@ -796,6 +796,7 @@ if len(self.images)<=1 or renderer.option_image_nocomposite() or not allequal([im.origin for im in self.images]): for im in self.images: + print 'drawing', im im.draw(renderer) else: # make a composite image blending alpha @@ -809,8 +810,12 @@ ims) im.is_grayscale = False l, b, w, h = self.bbox.bounds + clippath, affine = self.get_transformed_clip_path_and_affine() + print 'compodite' + print 'clippath', affine + print 'affine', affine renderer.draw_image(l, b, im, self.bbox, - *self.get_transformed_clip_path_and_affine()) + clippath, affine) # render the axes for a in self.axes: a.draw(renderer) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |