splitting or reorganizing axes.py

Eric Firing <efiring@...229...> writes:

The main organizational change would separate the functionality that
is directly involved in manipulating the axes from the more specific
plotting methods. This could be done, for example, by putting the
former in an AxesBase class, and then letting Axes inherit that.

IMHO, it would make sense in the long term to make Axes a low-level
class with a well-defined interface, and implement high-level plotting
methods such as bar, boxplot, cohere, hist, specgram and what have you
using that interface outside of Axes. Currently at least some of these
methods "peek under the hood" by doing things like

    if not self._hold: self.cla()

This looks like it will be a pain to maintain if the implementation
details ever change. self._hold could probably be easily replaced by
self.ishold(), but moving the methods to another class would help
ensure that they stay kosher.

ยทยทยท

--
Jouni

Jouni K Seppanen wrote:

Eric Firing <efiring@...229...> writes:

The main organizational change would separate the functionality that
is directly involved in manipulating the axes from the more specific
plotting methods. This could be done, for example, by putting the
former in an AxesBase class, and then letting Axes inherit that.

IMHO, it would make sense in the long term to make Axes a low-level
class with a well-defined interface, and implement high-level plotting
methods such as bar, boxplot, cohere, hist, specgram and what have you
using that interface outside of Axes. Currently at least some of these
methods "peek under the hood" by doing things like

    if not self._hold: self.cla()

This looks like it will be a pain to maintain if the implementation
details ever change. self._hold could probably be easily replaced by
self.ishold(), but moving the methods to another class would help
ensure that they stay kosher.

Jouni,

I think what you are proposing is a bit different from what John suggested in his subsequent message, but a common element is the separation of Axes nuts and bolts from fancier plotting. I will do that relatively simple job first; I think it will facilitate any subsequent more extensive refactoring.

Eric