matplotlib如何出现多个figure
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-1,1,50) # -1到1平分50个点
y1 = 2*x+1
y2 = x**2
plt.figure()
plt.plot(x,y1)
plt.figure(num=3,figsize=(8,5))
plt.plot(x,y2)
plt.show()
想定义多个figure,每一个plt.figure()和其下方对应的plt的内容就是一个figure
figur.
原创
2022-01-12 21:29:51 ·
1409 阅读 ·
0 评论