LinuxmacOSWindows

Where Is the Matplotlib Config File?

Matplotlib rc lookup with per-OS config roots plus cache split.

Last updated

Matplotlib resolves rc files through an ordered lookup from cwd through env to per-OS homes. Cache follows its own function with env override. Lookup functions report live paths.

Linux splits config and cache homes while Windows merges. macOS keeps a dot folder legacy. Keep the rc file; drop the cache.

Where Matplotlib stores this, by platform

Linux
~/.config/matplotlib/matplotlibrc

Ordered rc lookup from cwd through env to XDG home. Cache split under cache home. Functions report live paths. Env redirects both.

macOS
~/.matplotlib/matplotlibrc

Same lookup with dot folder legacy plus shared cache beneath.

Windows
%LocalAppData%\matplotlib\matplotlibrc

Same lookup merged under LocalAppData for config plus cache.

Frequently asked questions

How do I back up Matplotlib?

Copy the rc file matching the running lookup with Python idle. Cache rebuilds on demand. Restoring means putting the rc back before importing.

How do I relocate config or cache?

Env vars redirect both config and cache roots. Linux splits homes while Windows merges them. Query the live functions instead of guessing paths.

Notice an outdated path? Let us know.