I am new to python and pyplot . I am trying to understand the documentation for the Matplotlib API related to the drawing of the Drawing API .
The beginning says there is a class matplotlib.figure.AxesStack , and then
AxesStack is 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 an error
AttributeError: 'Figure' object has no attribute 'ax_stack'
source share