8000 pcolor range bug fix · takluyver/matplotlib@5b194a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b194a4

Browse files
committed
pcolor range bug fix
1 parent f10c2ab commit 5b194a4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/matplotlib/axes.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7364,6 +7364,20 @@ def pcolor(self, *args, **kwargs):
73647364

73657365
x = X.compressed()
73667366
y = Y.compressed()
7367+
7368+
# Transform from native to data coordinates?
7369+
t = collection._transform
7370+
if (not isinstance(t, mtransforms.Transform)
7371+
and hasattr(t, '_as_mpl_transform')):
7372+
t = t._as_mpl_transform(self.axes)
7373+
7374+
if t and any(t.contains_branch_seperately(self.transData)):
7375+
trans_to_data = t - self.transData
7376+
pts = np.vstack([x, y]).T.astype(np.float)
7377+
transformed_pts = trans_to_data.transform(pts)
7378+
x = transformed_pts[..., 0]
7379+
y = transformed_pts[..., 1]
7380+
73677381
minx = np.amin(x)
73687382
maxx = np.amax(x)
73697383
miny = np.amin(y)

0 commit comments

Comments
 (0)
0