Skip to content
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

gh-398: consistent plotting for notebooks #425

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

paddyroddy
Copy link
Member

@paddyroddy paddyroddy commented Nov 15, 2024

Closes #398. Adds a .matplotlibrc to stabilise the production of plots. For more detail on the config file, look at https://matplotlib.org/stable/users/explain/customizing.html#the-matplotlibrc-file. I haven't used a stylesheet (plt.style.use), as (except for classic) they don't define the resolution etc. https://github.com/matplotlib/matplotlib/tree/main/lib/matplotlib/mpl-data/stylelib.

I did run the notebooks, but they must be using these current values.

@paddyroddy paddyroddy added documentation Improvements or additions to documentation enhancement New feature or request science Science improvement or question labels Nov 15, 2024
@paddyroddy paddyroddy self-assigned this Nov 15, 2024
Comment on lines +46 to +48
"# set up matplotlib to produce consistent figures\n",
"mpl.rc_file(pathlib.Path.cwd().parents[1] / \".matplotlibrc\")\n",
"\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I though it automatically picks up the config from the config file in the current working directory? Is something like that not possible?

Copy link
Member Author

@paddyroddy paddyroddy Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I've read it has to be maplotlibrc (i.e. without the dot). Plus, we have notebooks in two different subfolders, so I think it's safer to force load.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request science Science improvement or question
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a matplotlibrc to control the resolution of the notebooks figures
2 participants