-
Notifications
You must be signed in to change notification settings - Fork 22
importing napari-matplotlib modifies how plots are shown in jupyter notebooks #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We had a similar issue earlier in another plugin and this is how we solved it: I hope this helps! :-) |
Hi @haesleinhuepf , I think a similar issue has been discussed here and I thought it was also seeb as not desirable to change the global matplotlib behavior. I've seen the same thing happening for other plots (napari-style color scheme) so the global variables must have been set somewhere else, anyway. Another quick fix that I use a lot would be: import matplotlib as mpl
mpl.style.use('default') |
That's a great workaround. Thanks, @jo-mueller .
Can you give an example and create a GitHub issue on the affected project? |
I mean more that the matplotlib global variables must have been set somewhere else within the scope of napari-matplotlib. I think here. A workaround would be to set the ax parameters (facecolors, etc) where the @dstansby would it be acceptable for you to define the display parameters in the |
Use plt.subplots for safety. And no longer need copy.deepcopy. Save eyes and make a lovely histogram.
Use plt.subplots for safety. And no longer need copy.deepcopy. Save eyes and make a lovely histogram.
... and it should not.
The visualization of plots in matplotlib change after
napari_matplotlib
has been imported. Global settings e.g. here should not be modified by a napari-plugin. Consider programming napari-plugins side-effect free.To reproduce:
The same can be observed when not importing
napari_matplotlib
but instead opening a viewer where napari-stress is installed, because starting the viewer importsnapari_stress
and this importsnapari_matplotlib
in the background. A napari-plugin should not modify how things are displayed in jupyter notebooks. It's kind of evil usage of global variables.CC @jo-mueller
The text was updated successfully, but these errors were encountered: