matplotlib的官方API介绍:
https://matplotlib.org/2.0.0/api/index.html
1、pyplot模块
pyplot
matplotlib.pyplot
Provides a MATLAB-like plotting framework.
pylab combines pyplot with numpy into a single namespace. This is convenient for interactive work, but for programming it is recommended that the namespaces be kept separate, e.g.:
(翻译:提供一个类似MATLAB的绘图框架。
pylab将pyplot与numpy结合到一个名称空间中。 这对交互式工作很方便,但对于编程,建议将名称空间保持分开,例如:)
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0, 5, 0.1);
y = np.sin(x)
plt.plot(x, y)
plt.show()