Description
It appeared in the thread http://matplotlib.1069221.n5.nabble.com/RendererAgg-int-width-int-height-dpi-debug-False-ValueError-width-and-height-must-each-be-below-32768-td27756.html that figure.get_size_inches() returns unexpetedly a view of a numpy array. Views behave unexpectedly to users not familiar with numpy.
- The http://matplotlib.org/api/figure_api.html?highlight=get_size_inches#matplotlib.figure.Figure.get_size_inches needs to be written. Special care needs to be to expain what Ben wrote in the thread:
So, to force DefaultSize to be immutable, just cast it as a tuple:
DefaultSize = tuple(F.get_size_inches())
-
A link to get_size_inches() should be introduced from set_size_inches(), that is where users are likely to hit this issue.
http://matplotlib.org/api/figure_api.html?highlight=set_size_inches#matplotlib.figure.Figure.set_size_inches -
Once users sets a wrong figure size or something gets screwed (don't know the cause), a stacktrace like this is returned. Please improve the error message to provide more details about what has the user passed so bad to matplotlib. This is from mpl-1.2.1
File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 1362, in savefig
self.canvas.print_figure(_args, *_kwargs)
File "/usr/lib64/python2.7/site-packages/matplotlib/backend_bases.py", line 2096, in print_figure
**kwargs)
File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 492, in print_png
FigureCanvasAgg.draw(self)
File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 435, in draw
self.renderer = self.get_renderer()
File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 454, in get_renderer
self.renderer = RendererAgg(w, h, self.figure.dpi)
File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 85, in init
self._renderer = _RendererAgg(int(width), int(height), dpi, debug=False)
ValueError: width and height must each be below 32768