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

Skip to content

Commit be2d36d

Browse files
committed
fixed contour autoscale w w,y
svn path=/trunk/matplotlib/; revision=871
1 parent e586339 commit be2d36d

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

lib/matplotlib/axes.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,8 +1069,17 @@ def autolev(N):
10691069
collections.append(col)
10701070

10711071

1072-
self.set_xlim([0,imax])
1073-
self.set_ylim([0,jmax])
1072+
if x is not None:
1073+
rx = ravel(x)
1074+
self.set_xlim((min(rx), max(rx)))
1075+
else:
1076+
self.set_xlim([0,imax])
1077+
1078+
if y is not None:
1079+
ry = ravel(y)
1080+
self.set_ylim((min(ry), max(ry)))
1081+
else:
1082+
self.set_ylim([0,jmax])
10741083

10751084
return levels, collections
10761085

lib/matplotlib/image.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ def changed(self):
107107
cm.ScalarMappable.changed(self)
108108

109109
def make_image(self, flipy):
110-
111110
if self._A is not None:
112111
if self._imcache is None:
113112
x = self.to_rgba(self._A, self._alpha)
@@ -139,7 +138,7 @@ def make_image(self, flipy):
139138
# the viewport scale factor
140139
sx = dxintv/self.axes.viewLim.width()
141140
sy = dyintv/self.axes.viewLim.height()
142-
141+
143142
if im.get_interpolation()!=_image.NEAREST:
144143
im.apply_translation(-1, -1)
145144

0 commit comments

Comments
 (0)