我有一个对象 fig2,它是一个类 mathplotlib.axes.axessubplot,但是当我尝试执行 fig2.show() 时,python 说 axessubplot 对象没有属性显示。如何显示 AxesSubplot?
最佳答案
你应该调用matplotlib.pyplot.show()
,这是一个显示所有图形的方法。
如果你已经导入为plt
,那么:
import matplotlib.pyplot as plt
# create fig1 (of type plt.figure)
# create fig2
plt.show() # will display fig1 and fig2 in different windows
关于python - 如何在 Python 中显示 AxesSubplot?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26540567/