Python 3.x 是否永久更改matplotlib中的页边距?

Python 3.x 是否永久更改matplotlib中的页边距?,python-3.x,matplotlib,jupyter-notebook,margins,Python 3.x,Matplotlib,Jupyter Notebook,Margins,matplotlib的默认xmargins和ymargins为0.05。我想永久性地将这些更改为零 因此,我转到电脑上的matplotlib rc文件()并将axes.xmargin和axes.ymargin更改为0。我通过键入matplotlib.matplotlib\u fname()找到了此文件的路径 我在jupyter笔记本中输入了print(matplotlib.rcParams[“axes.xmargin”])in,结果返回0.05,因此显然没有进行更改。即使我在加载python后在

matplotlib的默认xmargins和ymargins为0.05。我想永久性地将这些更改为零

因此,我转到电脑上的matplotlib rc文件()并将
axes.xmargin
axes.ymargin
更改为0。我通过键入
matplotlib.matplotlib\u fname()
找到了此文件的路径

我在jupyter笔记本中输入了
print(matplotlib.rcParams[“axes.xmargin”])
in,结果返回0.05,因此显然没有进行更改。即使我在加载python后在命令行中简单地输入这个,边距也没有改变

但我已经手动更改了它。以下是我如何编辑该文件的屏幕截图:

如您所见,轴都设置为零


我已经在命令行中键入了
conda install matplotlib
,看看这是否会改变什么,但什么都没有改变

你显然编辑错了文件。有关如何找到要编辑的文件的信息,请参阅。@ImportanceOfBeingErnest我在命令窗口中加载python时,导入matplotlib,然后输入
matplotlib.matplotlib\u fname()。然后我修改了这个文件?检查在jupyter笔记本中这个路径是否正确different@ImportanceOfBeingErnest这是同一条路,这是不幸的。更改后是否重新加载内核?这也可能意味着你有一些其他的代码来设置设置。您可以检查
print(matplotlib.rcParams[“axes.xmargin”])
以查看是否应用了它。