[SPRINT] Refactored the axes module to split it in smaller chunks. by NelleV · Pull Request #1931 · matplotlib/matplotlib
I've also constructed an Axes object programmatically using the OO interface and a basic plot command works as expected.
import matplotlib matplotlib.use('pdf') from matplotlib.figure import Figure from matplotlib.backends.backend_pdf import FigureCanvasPdf as figcan fig = Figure() can = figcan(fig) ax = fig.add_axes([0.1, 0.1, 0.8, 0.8]) ax.plot([1, 2, 3]) fig.savefig('asdf.pdf')
3D axes also works using the usual from mpl_tookits.mplot3d import Axes3D and setting the projection on the ax object.
Notice the repr (or str, I can never remember which one) has changed to <matplotlib.axes._axes.Axes at 0x10a0b91d0>. That said, it's reasonable for us to assume that people don't depend on that output.