【问题标题】:set jupyter notebook inlinebackend figsize larger设置 jupyter notebook inlinebackend figsize 更大
【发布时间】:2016-09-18 10:04:09
【问题描述】:

我使用 jupyter notebook 在 python 中进行绘图。我在自己的 .mplstyle 文件中设置了 figsize=2.55,1.91,非常小,但适合我的科学论文。现在我用自己的style文件在notebook中绘制图片,图片太小了,怎么放大?

我试过How to set the matplotlib figure default size in ipython notebook?这里的方法,好像不行。我不想更改样式文件中的 figsize,因为我必须使用该 figsize 保存图像。如何在更大尺寸的笔记本中显示?

【问题讨论】:

    标签: python matplotlib jupyter jupyter-notebook


    【解决方案1】:

    对于所有笔记本:将其与您想要的 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)
    

    【讨论】:

      猜你喜欢
      • 2018-04-25
      • 1970-01-01
      • 1970-01-01
      • 2021-10-29
      • 1970-01-01
      • 2017-04-06
      • 1970-01-01
      • 2020-06-08
      • 2016-05-30
      相关资源
      最近更新 更多