matplotlib/matplotlib — pull request #1032 by WeatherGod (2012-07-21 00:13:19+00:00)
Title: Axesbase

This is a rather involved and invasive PR, and isn't ready for merging. But I wanted to give others a chance to try it out and comment on what I have done.

Essentially, I want to segregate the plotting functions from the maintenance methods in the Axes class. There are several reasons for this, some of which is too involved to go into right now. A practical upshot of this is that the API page for axes.py is *much* smaller! Further, as I move methods over to AxesBase, I have been making them axis-agnostic. I want to eventually eliminate ax.xaxis and ax.yaxis in favor of ax.axis['x'] dictionaries. The idea is that most methods actually do not care about which axis objects to act on be made into a method that operates over an ordered dictionary of axis objects. This will allow for arbitrary names of axis and an arbitrary number of axis objects.

I have put in backwards-compatibility shims where needed. It is still intended that everyone should subclass the Axes class for their uses until this refactor is completed. And even after the refactor, everyone's existing code should still work if they are subclassing Axes instead of AxesBase.

There is only one caveat I could find. The compatibility shim I used for ax.xaxis and ax.yaxis is to define some class properties to intercept the gets and sets to the internal dictionary. This means that xaxis and yaxis exist from the onset of the Axes construction, whereas before, the xaxis and yaxis didn't exist until sometime during the Axes constructor. So, any code that checked for the existance of xaxis and yaxis before acting on them should be changed to check for None.

So,
```hasattr(ax, 'xaxis')```
should be changed to
```ax.xaxis is not None```