import matplotlib.pyplot as plt
import numpy as np
plt.figure(1)
plt.plot([1, 2, 3, 4], [1, 4, 9, 16])
plt.plot([1,2,3,4])
plt.ylabel('some numbers')
plt.plot([1,2,3,4], [1,4,9,16], 'ro')#绘制散点图
plt.scatter([4,5,6,7],[1,2,3,4])#绘制散点图
plt.axis([0, 6, 0, 20])#设置x轴与y轴的范围
#plt.figure(2)
t = np.arange(0,5,0.2)
# red dashes, blue squares and green triangles
plt.plot(t, t, 'r--', t, t**2, 'bo', t, t**3, 'g^')
plt.grid(True)
plt.show()
https://www.runoob.com/w3cnote/matplotlib-tutorial.html 菜鸟教程