matplotlib-pyodide icon indicating copy to clipboard operation
matplotlib-pyodide copied to clipboard

Generating the same graph multiple times with new `document.pyodideMplTarget` objects cause every 2nd graph to disappear.

Open coatless opened this issue 1 year ago • 1 comments

Under matplotlib_pyodide.html5_canvas_backend, I'm setting a new HTML object to document.pyodideMplTarget and, then, executing code to generate the plot. However, running the cell back-to-back seems to cause the graph to disappear on the second call and, then, reappear on the third call.

See the following GIF for an example:

mpl-backend-hiccup-on-repeat-plots

coatless avatar Feb 21 '24 07:02 coatless

I had this issue as well. It can be avoided by putting "fig=plt.figure()" before creating the plot.

KBurbank avatar Mar 22 '24 16:03 KBurbank