How to get a list of axes for a figure in pyplot?
Question: I am new to `python` and `pyplot`. I am trying to understand the documentation
for the Matplotlib API related to the Figure [Figure
API](http://matplotlib.org/api/figure_api.html).

In the beginning it says there is a `class matplotlib.figure.AxesStack`, and
then

> The AxesStack is a callable, where ax_stack() returns the current axes

When I try to use this in a program

    
    
    import numpy as np
    import matplotlib.pyplot as plt
    
    n=4
    v=np.arange(n)
    X,Y = np.meshgrid(v,v)
    Z=np.random.rand(n-1,n-1)
    
    fig, ax = plt.subplots()
    plt.pcolormesh(X, Y, Z)
    plt.axis('tight')
    plt.colorbar()
    ast=fig.ax_stack()
    
    plt.show()
    

I get error

    
    
    AttributeError: 'Figure' object has no attribute 'ax_stack'
    


Answer: The property `axes` returns a list of the `Axes` objects in the `Figure`
object:

    
    
    ax_list = fig.axes
    

([doc](http://matplotlib.org/api/figure_api.html#matplotlib.figure.Figure.axes))

