Commit 014c02b
committed
Don't crash on str(figimage(...)).
`im = figimage(np.random.rand(100, 100), xo=100, yo=100); print(im)`
Previously:
```
Traceback (most recent call last):
File "<string>", line 4, in <module>
File "/usr/lib/python3.7/site-packages/matplotlib/image.py", line 184, in __str__
return "AxesImage(%g,%g;%gx%g)" % tuple(self.axes.bbox.bounds)
AttributeError: 'NoneType' object has no attribute 'bbox'
```
now:
```
<matplotlib.image.FigureImage object at 0x7fa97be63860>
```
Note that `AxesImage` actually already has the same `__str__` defined in
its own body (which this PR leaves untouched).
Defining a proper `__str__` for `FigureImage` (and other `_ImageBase`
subclasses) is not the object of this PR.1 parent dd18211 commit 014c02b
1 file changed
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | 180 | | |
184 | 181 | | |
185 | 182 | | |
| |||
0 commit comments