2014-10-24 8 views
9

Ho un oggetto fig2 che è una classe mathplotlib.axes.axessubplot, ma quando provo a eseguire fig2.show(), python dice che l'oggetto axessubplot non ha alcun attributo show. Come posso mostrare AxesSubplot? Come mostrare un AxesSubplot in Python?

risposta

13

È necessario chiamare matplotlib.pyplot.show(), che è un metodo che visualizza tutte le cifre.

Se è stato importato come plt, quindi:

import matplotlib.pyplot as plt 

# create fig1 (of type plt.figure) 
# create fig2 

plt.show() # will display fig1 and fig2 in different windows 
3

In alternativa, si potrebbe chiamare l'attributo figura di vostro fig2:

fig2.figure 
Problemi correlati