matplotlib/matplotlib — pull request #3866 by mdboom (2014-12-01 19:18:17+00:00)
Title: Regression in transforms: raises exception when applied to single point

The following code snippet (taken from #3809) which transforms a single point used to work in v1.4.2 but does not work with latest master (it raises "ValueError: Expected 2-dimensional array, got 1"). Bisection of the history showed that the regression was introduced in commit be34210a8c when PR #3646 was merged.

```python
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
import numpy as np

fig = Figure(figsize=(8,6))
canvas = FigureCanvas(fig)
ax = fig.add_subplot(1,1,1)
ax.transData.transform((1,1)) # <--- exception thrown here
```

Full traceback:

```
Traceback (most recent call last):
File "regression.py", line 9, in
ax.transData.transform((1,1)) # <--- exception thrown here
File "/home/albert/work/code/matplotlib/lib/matplotlib/transforms.py", line 1289, in transform
return self.transform_affine(self.transform_non_affine(values))
File "/home/albert/work/code/matplotlib/lib/matplotlib/transforms.py", line 2259, in transform_affine
return self.get_affine().transform(points)
File "/home/albert/work/code/matplotlib/lib/matplotlib/transforms.py", line 1583, in transform
return self.transform_affine(values)
File "/home/albert/work/code/matplotlib/lib/matplotlib/transforms.py", line 1667, in transform_affine
return affine_transform(points, mtx)
ValueError: Expected 2-dimensional array, got 1
```