【问题标题】:how matplotlib create and deliver plot to jupyter notebook?matplotlib 如何创建绘图并将其交付给 jupyter notebook?
【发布时间】:2019-01-31 18:08:35
【问题描述】:

在 jupyter notebook 中,我们可以使用 %matplotlib inline 来引导内联 python 脚本创建的图像。任何人都可以用 5 句话解释幕后发生的事情以实现这一目标吗?如果我想要一些网页来托管 matplotlib 创建的情节,这可能吗?谢谢~

【问题讨论】:

    标签: python matplotlib jupyter-notebook


    【解决方案1】:

    内联后端本质上调用fig.savefig(buffer, format="png", bbox_inches="tight"),其中fig 是要显示的数字。然后它将在 jupyter 的输出部分的 <img> 标记内提供 buffer 的内容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-11-14
      • 2017-05-11
      • 1970-01-01
      • 2016-11-16
      • 2021-02-23
      • 2016-12-30
      • 1970-01-01
      相关资源
      最近更新 更多