how to change matplotlibrc default directory

1.2k Views Asked by At

I'm currently using anaconda and python 3.6 on windows bash. Every time i want to use matplotlib I have to paste a copy of the matplotlibrc file into my working directory otherwise my code won't run or plot and I get the warning - /home/computer/anaconda3/lib/python3.6/site-packages/matplotlib/init.py:1022: UserWarning: could not find rc file;returning defaults

my matplotlibrc file is located at C:\Users\user\AppData\Local\lxss\home\puter\anaconda3\lib\python3.6\site-packages\matplotlib\mpl-data

I thought to fix this I could edit my .condarc file and set it to look for matplotlibrc in the correct directory. Could anyone tell me how to do this?

1

There are 1 best solutions below

0
On BEST ANSWER

It looks like when anaconda or matplotlib was installed it's created the matplotlibrc file in C:\Users\user\AppData\Local\lxss\home\puter\anaconda3\lib\py‌​thon3.6\site-package‌​s\matplotlib\mpl-dat‌​a using the windows environment. This has caused the file not to be recognised in WSL.

To fix this create another matplotlibrc file in bash or whatever shell you're using. In the directory listed above copy the contents of the previously created matplotlibrc file into your new matplotlibrc file. Make sure you don't create this file in the windows environment otherwise it won't be recognised.