You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This turns out to be intended, although unpleasant behavior of matplotlib\backend_bases.py:
"when bbox_inches == "tight", it saves the figure
twice. The first save command is just to estimate
the bounding box of the figure. A stringIO object is
used as a temporary file object, but it causes a
problem for some backends (ps backend with
usetex=True) if they expect a filename, not a
file-like object. As I think it is best to change
the backend to support file-like object, i'm going
to leave it as it is. However, a better solution
than stringIO seems to be needed. -JJL
result = getattr(self, method_name)"
I had to hook matplotlib.Figure.draw for unrelated reasons and noticed it gets called twice in ipython notebook. Is this intentional?
Tracing through all method calls on figure, I found that a plain python script will call
clf
set_canvas
add_axobserver
add_subplot
sca
set_size_inches
draw
get_rasterized
get_agg_filter
get_visible
get_agg_filter
get_rasterized
While notebook will call
clf
set_canvas
add_subplot
sca
get_facecolor
get_edgecolor
set_facecolor
set_edgecolor
get_facecolor
get_edgecolor
set_facecolor
set_edgecolor
draw
get_rasterized
get_agg_filter
get_visible
get_agg_filter
get_rasterized
get_tightbbox
draw
get_rasterized
get_agg_filter
get_visible
get_agg_filter
get_rasterized
set_facecolor
set_edgecolor
set_canvas
set_facecolor
set_edgecolor
You can run https://gist.github.com/tricubic/0d33d808a0d7fa7dbf22 in notebook or as a script to repeat this.
The text was updated successfully, but these errors were encountered: