-
Notifications
You must be signed in to change notification settings - Fork 22
Create a matplotlibrc file #36
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
Hey @dstansby ! Sorry for my ignorance of how matplotlib configs work, but is setting the configs in this manner "global"? One common use case in napari is people launch a viewer from a jupyter notebook and I think we want to make sure that styling changes made in the plot do not affect styling of plots in the notebook. |
Just tried adding a mplstyle file to the repo but this changes plotting in Jupyterlab as well :/ |
I think the way to fix that is use the instructions at https://matplotlib.org/stable/tutorials/introductory/customizing.html#temporary-rc-settings to use a context manager inside |
Thanks for the link - would you then add the decorator to every call to the |
I think it would be sufficient to put a context manager around this line:
and also anywhere a new Axes is created in the non-base widgets. |
Thanks @dstansby , I tried a few things and it seems that the context manager has to go where the axes object is created, for instance here in the Histogram widget:
Putting it around/into the |
Going to close this, since work ongoing in other issues and PRs covers this. |
Currently we set style options using several lines of code:
napari-matplotlib/src/napari_matplotlib/base.py
Lines 9 to 13 in 1ec14d3
Instead we should put these in a
matplotlibrc
file, to reduce lines of code, and make it easier to edit and see what style settings are being set all in one go.The text was updated successfully, but these errors were encountered: