matplotlib 绘图在 google colab 中不起作用

Jun*_*oon 6 python matplotlib google-colaboratory

我想在 colab 中使用 matplotlib 但它没有用。正如此链接所说,我尝试了两者%matplotlib inline%matplotlib notebook但它们都不起作用。但是我能问一下为什么这个链接图运行良好吗?似乎它只是使用普通的 matplotlib 和%matplotlib inline. 我想知道区别。

小智 7

根据colab文档:

在 IPython 笔记本中,您还可以选择直接在笔记本中嵌入图形,有两种可能的选项:

%matplotlib notebook将导致嵌入笔记本中的交互式绘图。

%matplotlib inline将导致您的绘图的静态图像嵌入到笔记本中。