如何检查/是否使用了matplotlibrc

时间:2016-07-04 18:17:31

标签: python-2.7 matplotlib wxpython

我在anaconda环境中使用python。当我导入matplotlib时,我遇到了与xwpython的兼容性问题。所以,我想切换后端。通常,这将使用matplotlibrc文件完成。但是,似乎忽略了~/.config/matplotlib/下的matplotlibrc。是否可以检查在导入matplotlib期间是否使用了matplotlibrc文件?使用python 2.7。

1 个答案:

答案 0 :(得分:6)

您可以使用以下方式获取文件路径:

import matplotlib
print(matplotlib.matplotlib_fname())

在我的情况下返回:

  

' /Users/m300241/.matplotlib/matplotlibrc'

相关问题