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

Skip to content

Commit 0b43f83

Browse files
committed
Support transforming scalars as some routines need this.
1 parent 7d35c5e commit 0b43f83

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/transforms.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,9 @@ def transform(self, values):
12991299
res = self.transform_affine(self.transform_non_affine(values))
13001300

13011301
# Convert the result back to the shape of the input values.
1302+
if ndim == 0:
1303+
assert not np.ma.is_masked(res) # just to be on the safe side
1304+
return res[0, 0]
13021305
if ndim == 1:
13031306
return res.reshape(-1)
13041307
elif ndim == 2:

0 commit comments

Comments
 (0)