参考文档:
https://zhuanlan.zhihu.com/p/26739300?group_id=843868091631955968
https://blog.youkuaiyun.com/kwame211/article/details/78082289?locationNum=7&fps=1
Matplotlib 集成
如果你用 Python 绘制过图形,那你肯定知道 matplotlib。Matplotlib 是一个用于创建漂亮图形的 Python 库,结合 Jupyter notebook 使用时体验更佳。
要想在 Jupyter notebook 中使用 matplotlib,需要告诉 Jupyter 获取 matplotlib 生成的所有图形,并将其嵌入 notebook 中。为此,需要计算:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(20)
y = x**2
plt.plot(x, y)