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

[Feature Rquest] Option to make a new canvas for every plt.show()

Open mglsj opened this issue 10 months ago • 3 comments

Currently plt.show() only creates one canvas and reuses it for all subsequent calls. Can an additional flag be added to create a new canvas every time.

mglsj avatar Jan 13 '25 09:01 mglsj

pyplot.show() does not accept any parameters. So instead of patching show, I would recommend to save the figure (plt.savefig) then put it to the place you want, which is more flexible.

ryanking13 avatar Jan 14 '25 08:01 ryanking13

pyplot.show() does not accept any parameters. So instead of patching show, I would recommend to save the figure (plt.savefig) then put it to the place you want, which is more flexible.

I'm using plt.savefig as a temporary fix by overriding the show, but I'm trying to create a Jupyter Notebook like environment where every show creates a new figure, and would be nice if it could be done natively. (I'm aware that jupyter lite uses a custom matplotlib inline renderer)

mglsj avatar Jan 15 '25 05:01 mglsj

Unfortunately, we lack human resources to maintain this package (see: #65). Feel free to fork the project and add features you need. But I don't think we can implement this feature or accept PRs.

ryanking13 avatar Jan 15 '25 07:01 ryanking13