Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Support transforming scalars as some routines need this.
  • Loading branch information
maxalbert committed Dec 4, 2014
commit 0b43f8397ec2b10a23e835209c1a61570819dbec
3 changes: 3 additions & 0 deletions lib/matplotlib/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1299,6 +1299,9 @@ def transform(self, values):
res = self.transform_affine(self.transform_non_affine(values))

# Convert the result back to the shape of the input values.
if ndim == 0:
assert not np.ma.is_masked(res) # just to be on the safe side
return res[0, 0]
if ndim == 1:
return res.reshape(-1)
elif ndim == 2:
Expand Down