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
I am used to work with %matplotlib notebook in my notebooks to be able to navigate in the plots (zoom, etc.). But I realized that if I put %matplotlib notebook, the ProPlot plots do not show up and I need to come back to %matplotlib inline to make it work again. I am doing something wrong or is this supposed to work for ProPlot too? And if not, is this planned to be working in the future?
This is a known issue (#62) -- the ProPlot tight layout algorithm sets the figure size automatically, so when you manually resize with interactive backends it gets instantly "snapped back" into place by the algorithm. In an upcoming patch (v0.1.4) I will have fig.set_size_inches() override the algorithm so that you can use interactive backends.
The notebook backend is a special case I think -- it internally tries to resize the figure, which triggers a redraw, which itself triggers a resize, ad infinitum. Looks terrible. This issue has high priority.
I fixed this and released a new version on PyPi. Run
pip install --upgrade proplot
To use the notebook backend, you can use %matplotlib notebook, but that will bypass some useful things that ipython_matplotlib does to keep the style the same as the inline backend, so I recommend using
or adding the line matplotlib: notebook to the .proplotrc file that should have been automatically created in your home directory.
Note that the tight layout algorithm and automatic figure rescaling must be automatically disabled for this backend... unfortunately I could not find any obvious workaround. The inline notebook backend is "special". Also note that the performance is not great when you have figure "super titles" or row/column labels on... I think this will be improved when #50 and #46 are done.
Thanks for the quick fix! I have just updated ProPlot and it works already, just cutting some side of the color bar in my example (I guess that's what you are mentioning):
PS: I have just discovered your package yesterday and I am impressed with it so far (more convenient and improving the existing matplolib/cartopy that I am used to)! Thanks for this great work!
FYI @lukelbd , pip install proplot --upgrade won't work until you bump above v1.0. If users have proplot installed from the original repo, you had the version set to 1.0. So it sees the current pip version as being a lower version and thus won't upgrade automatically. Folks have to uninstall first then reinstall.
Activity
[-]Does %matplotlib notebook supposed to works?[/-][+]Does %matplotlib notebook supposed to work?[/+]lukelbd commentedon Dec 2, 2019
This is a known issue (#62) -- the ProPlot tight layout algorithm sets the figure size automatically, so when you manually resize with interactive backends it gets instantly "snapped back" into place by the algorithm. In an upcoming patch (v0.1.4) I will have
fig.set_size_inches()override the algorithm so that you can use interactive backends.lukelbd commentedon Dec 2, 2019
For justification of why ProPlot sets the figure size automatically, see this page.
lukelbd commentedon Dec 2, 2019
Just tried out
The notebook backend is a special case I think -- it internally tries to resize the figure, which triggers a redraw, which itself triggers a resize, ad infinitum. Looks terrible. This issue has high priority.
lukelbd commentedon Dec 3, 2019
I fixed this and released a new version on PyPi. Run
To use the notebook backend, you can use
%matplotlib notebook, but that will bypass some useful things that ipython_matplotlib does to keep the style the same as the inline backend, so I recommend usingor adding the line
matplotlib: notebookto the.proplotrcfile that should have been automatically created in your home directory.Note that the tight layout algorithm and automatic figure rescaling must be automatically disabled for this backend... unfortunately I could not find any obvious workaround. The inline notebook backend is "special". Also note that the performance is not great when you have figure "super titles" or row/column labels on... I think this will be improved when #50 and #46 are done.
mickaellalande commentedon Dec 3, 2019
Thanks for the quick fix! I have just updated ProPlot and it works already, just cutting some side of the color bar in my example (I guess that's what you are mentioning):
File: snc_LImon_IPSL-CM6A-LR_historical_r1i1p1f1_gr_185001.zip
PS: I have just discovered your package yesterday and I am impressed with it so far (more convenient and improving the existing matplolib/cartopy that I am used to)! Thanks for this great work!
bradyrx commentedon Dec 3, 2019
FYI @lukelbd ,
pip install proplot --upgradewon't work until you bump above v1.0. If users haveproplotinstalled from the original repo, you had the version set to 1.0. So it sees the current pip version as being a lower version and thus won't upgrade automatically. Folks have to uninstall first then reinstall.lukelbd commentedon Dec 4, 2019
@bradyrx This is now addressed in the README and install page.