ipython-contrib / jupyter_contrib_nbextensions

A collection of various notebook extensions for Jupyter
http://jupyter-contrib-nbextensions.readthedocs.io/en/latest
Other
5.2k stars 806 forks source link

Idea for new extension: a graphical tool for defining figure layout #1516

Open sgowda opened 4 years ago

sgowda commented 4 years ago

I had an idea for a new extension that could be useful to matplotlib users who want to make intricate plots (such as scientific paper plots) in pure python (rather than using tools like Photoshop). The basic idea is to use JS to inject an HTML canvas into the output of a jupyter notebook cell. Then the user can define their plot layout graphically using the mouse, as well as split plots into multiple pieces, align to different reference points, etc. When the user is done, the layout is converted to matplotlib code which produces (roughly) the same figure and python code is automatically populated into the next cell.

Would this extension be of interest here? I haven't been able to find any existing features which do this, though perhaps I haven't been looking in the right places.

I have partially implemented the extension here. It is a bit rough around the edges at the moment but it shows the concept.