Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cb1f42d

Browse files
committed
commited jae joons 2nd patch; figimage still sems broken for origin=up
svn path=/trunk/matplotlib/; revision=6380
1 parent 3b34400 commit cb1f42d

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

examples/pylab_examples/layer_images.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,19 @@ def func3(x,y):
2727
extent = xmin, xmax, ymin, ymax
2828
Z1 = array(([0,1]*4 + [1,0]*4)*4); Z1.shape = 8,8 # chessboard
2929
im1 = imshow(Z1, cmap=cm.gray, interpolation='nearest',
30-
extent=extent)
30+
extent=extent, origin='lower')
3131
hold(True)
3232

3333
Z2 = func3(X, Y)
3434

3535
im2 = imshow(Z2, cmap=cm.jet, alpha=.9, interpolation='bilinear',
36-
extent=extent)
36+
extent=extent, origin='lower')
3737
#axis([xmin, xmax, ymin, ymax])
3838

3939

40-
#savefig('layer_images')
40+
savefig('layer_images.png')
41+
savefig('layer_images.svg')
42+
savefig('layer_images.pdf')
4143

4244
show()
4345

lib/matplotlib/axes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,8 +1537,10 @@ def draw(self, renderer=None, inframe=False):
15371537
for im in self.images if im.get_visible()]
15381538

15391539
#flip the images if their origin is "upper"
1540-
if self.images[0].origin=='upper':
1541-
im.flipud_out()
1540+
for _im, (im,_,_) in zip(self.images, ims):
1541+
if _im.origin=="upper":
1542+
im.flipud_out()
1543+
15421544

15431545
l, b, r, t = self.bbox.extents
15441546
width = mag*((round(r) + 0.5) - (round(l) - 0.5))

0 commit comments

Comments
 (0)