Finding the rc configuration file

On Linux/Unix systems, you can set a global configuration for all users on the machine by editing /etc/matplotlibrc for $HOME/.matplotlib/matplotlib/rc or ~/.config/matplotlib/matplotlibrc.

On Windows, the default matplotlibrc file may be placed in C:\Python35\Lib\site-packagesTo find the path of the currently active matplotlibrc file, we can use the matplotlib_fname() function of Matplotlib in Python shell as follows:

In [1]: import matplotlib as mpl
        mpl.matplotlib_fname()
Out[1]: '/home/mary/.local/lib/python3.6/site-packages/matplotlib/mpl-data/matplotlibrc'
The rc configuration file is found under $INSTALL_DIR/matplotlib/mpl-data/matplotlibrc, where $INSTALL_DIR is where you installed Matplotlib, ...

Get Matplotlib for Python Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.