我使用 jupyter notebook 在 python 中绘图。我在自己的 .mplstyle 文件中设置了 figsize=2.55,1.91,非常小,但适合我的科学论文。现在用自己的style文件在notebook里画图,图太小了,怎么弄大点?
我试了这里的方法How to set the matplotlib figure default size in ipython notebook? ,好像不行。我不想更改样式文件中的图形大小,因为我必须使用该图形大小保存图像。如何在更大尺寸的笔记本中显示它?
最佳答案
对于所有的笔记本:把这个和你想要的 figsize
放在你的 ipython_kernel_config 中(对于 jupyter 5.x 及以上版本):
c = get_config()
c.InlineBackend.rc.update({"figure.figsize": (12, 10)})
您也可以在笔记本本身中完成:
%matplotlib inline
import matplotlib
matplotlib.rcParams["figure.figsize"] = (12, 10)
关于python - 将 jupyter notebook inlinebackend figsize 设置得更大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37358557/