1、折线图
import matplotlib.pyplot as plt
x = [1,2,3,4,5]
squares = [1,4,9,16,25]
plt.plot(x,squares)
plt.title("Squares")
plt.xlabel("Value")
plt.ylabel("square of value")
plt.tick_params(axis="both")
plt.show()
2、scatter绘制一系列点
import matplotlib.pyplot as plt
x_value = list(range(1,1001))
y = [x**2 for x in x_value]
plt.scatter(x_value,y)
plt.title("test")
plt.xlabel("x")
plt.ylabel("y")
plt.tick_params(axis="both")
plt.axis([0,1100,0,1100000])#设定坐标轴范围
plt.show()