我想绘制数据,然后创建一个新的图形并绘制数据2,最后回到原始图形并绘制数据3,就像这样:
FYI 如何告诉matplotlib我已经完成了一个图表?做了类似的事情,但不完全一样!它不允许我访问原始图表。
import numpy as np
import matplotlib as plt
x = arange(5)
y = np.exp(5)
plt.figure()
plt.plot(x, y)
z = np.sin(x)
plt.figure()
plt.plot(x, z)
w = np.cos(x)
plt.figure("""first figure""") # Here's the part I need
plt.plot(x, w)
FYI 如何告诉matplotlib我已经完成了一个图表?做了类似的事情,但不完全一样!它不允许我访问原始图表。
ax1.ylabel
,它会显示未找到。同样的情况也出现在fig1.ylabel
上... - George Datserisax1.set_xlabel("你的 x 标签")
,ax1.set_ylabel("你的 y 标签")
和ax1.set_title("你的标题")
。 - simonbplt.subplots(nrows, ncols)
更容易。已更新示例。 - simonb