gpt4 book ai didi

python - 如何在 Python 中显示 AxesSubplot?

转载 作者:IT老高 更新时间:2023-10-28 20:50:13 25 4
gpt4 key购买 nike

我有一个对象 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com