I have an object fig2 that is a class mathplotlib.axes.axessubplot, but when I try to execute fig2.show(), python says axessubplot object has no attribute show. How can I show AxesSubplot?
You should call matplotlib.pyplot.show()
, which is a method that displays all the figures.
If you have imported as plt
, then:
import matplotlib.pyplot as plt # create fig1 (of type plt.figure) # create fig2 plt.show() # will display fig1 and fig2 in different windows
Alternatively, you could call the figure attribute of your fig2:
fig2.figure
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With