如何更改 matplotlibrc 默认目录
how to change matplotlibrc default directory
我目前在 windows bash 上使用 anaconda 和 python 3.6。每次我想使用 matplotlib 时,我都必须将 matplotlibrc 文件的副本粘贴到我的工作目录中,否则我的代码将不会 运行 或绘图,我会收到警告 - /home/computer/anaconda3/lib/python3.6/site-packages/matplotlib/init.py:1022: 用户警告:找不到 rc 文件;正在返回默认值
我的 matplotlibrc 文件位于 C:\Users\user\AppData\Local\lxss\home\puter\anaconda3\lib\python3.6\site-packages\matplotlib\mpl-data
我想解决这个问题,我可以编辑我的 .condarc 文件并将其设置为在正确的目录中查找 matplotlibrc。谁能告诉我该怎么做?
看起来在安装 anaconda 或 matplotlib 时,它在 C:\Users\user\AppData\Local\lxss\home\puter\anaconda3\lib\py thon3.6\site-package s\matplotlib\mpl-dat a 使用 windows 环境。这导致文件无法在 WSL 中识别。
要解决此问题,请在 bash 或您正在使用的 shell 中创建另一个 matplotlibrc 文件。在上面列出的目录中,将之前创建的 matplotlibrc 文件的内容复制到新的 matplotlibrc 文件中。请确保您没有在 windows 环境中创建此文件,否则将无法识别。
我目前在 windows bash 上使用 anaconda 和 python 3.6。每次我想使用 matplotlib 时,我都必须将 matplotlibrc 文件的副本粘贴到我的工作目录中,否则我的代码将不会 运行 或绘图,我会收到警告 - /home/computer/anaconda3/lib/python3.6/site-packages/matplotlib/init.py:1022: 用户警告:找不到 rc 文件;正在返回默认值
我的 matplotlibrc 文件位于 C:\Users\user\AppData\Local\lxss\home\puter\anaconda3\lib\python3.6\site-packages\matplotlib\mpl-data
我想解决这个问题,我可以编辑我的 .condarc 文件并将其设置为在正确的目录中查找 matplotlibrc。谁能告诉我该怎么做?
看起来在安装 anaconda 或 matplotlib 时,它在 C:\Users\user\AppData\Local\lxss\home\puter\anaconda3\lib\py thon3.6\site-package s\matplotlib\mpl-dat a 使用 windows 环境。这导致文件无法在 WSL 中识别。
要解决此问题,请在 bash 或您正在使用的 shell 中创建另一个 matplotlibrc 文件。在上面列出的目录中,将之前创建的 matplotlibrc 文件的内容复制到新的 matplotlibrc 文件中。请确保您没有在 windows 环境中创建此文件,否则将无法识别。