File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -51,4 +51,8 @@ the current canvas to save the figure (if possible). Since `.FigureCanvasBase`
5151is Agg-based any Agg-based backend will create the same file output. There may
5252be slight differences for non-Agg backends; e.g. if you use "GTK4Cairo" as
5353interactive backend, ``fig.savefig("file.png") `` may create a slightly different
54- image depending on whether the figure is registered with pyplot or not.
54+ image depending on whether the figure is registered with pyplot or not. In
55+ general, you should not store a reference to the canvas, but rather always
56+ obtain it from the figure with ``fig.canvas ``. This will return the current
57+ canvas, which is either the original `.FigureCanvasBase ` or a backend-dependent
58+ subclass, depending on whether the figure is registered with pyplot or not.
You can’t perform that action at this time.
0 commit comments