Sorry to ask for the Nth time, but as essentially all of
> my plots require at least one log10 axis and as matplotlib
> looks better and better, I'm wondering about the status of
> log axes.
No need to apologize, pestering is a good thing since it motivates me
to do the things I already want to do when I know people want them.
> This has even brought me to the point of delving into the
> innards of matplotlib just to see how easy (or hard) it
> would be. So far, it looks possibly like overriding the
> various Artist.transform_*() methods and some additions to
> axes.py. Is this the case? Would I be duplicating effort
> if I jumped in at this point? I can't tell at this point
> how much work it looks to be -- any estimation?
This is certainly the core change. Other considerations are to get
tick labels to work properly (using exponential or some suitable
notation) and to get the tick locs right (choose them on the decades,
probably using some preset decade choices for the most common use
cases). And the changes need to be consistent with handle graphics,
so that the user can say, for example
set(gca(), 'xscale', 'log') or
set(gca(), 'xscale', 'linear)
and have the desired effect. The latter will happen automagically if
the Axes class defines a set_xscale and set_yscale method expecting
the string arg, which the then forwards the calls to a set_scale
method of the Axes._xaxis or Axes._yaxis instances.
I have been busier than anticipated over the last week so haven't been
able to address this issue as I had hoped, but have been tinkering
with it and thinking about it. If you look at CVS axes class, you'll
see the results of my tickering in the _scale, _scalemap, _scalefunc
attributes of the Axis class. I'm not at all convinced this is the
right design, though. One thing to consider is to factor the tick
loc-ing and labeling into a separate class to clean up the Axis
As far as your helping, that would be great. As far as how much time
it would take, I think it would take me anywhere from half a day to
two days to get it just right, but I'm inclined to the lower
estimates. Let me know how you want to proceed: I can envision
anything from you making the required changes and checking them into
CVS, to us collaborating on the design and implementation, to me just
getting off my ass and doing it. I would certainly welcome some input
from you, and know from the quality of your work on vision egg that it
would improve matplotlib. Which given your impending move to the
Dickinson lab, might be a good thing for you too
> However, I think "ticks = asarray(ticks)" would be
> cleaner, and probably little faster, too.
Right, I wrote some of the code a long time ago and would do this
differently now. My original thought was that in many of the use
cases the sequences would already be arrays and the try/except thing
would avoid a performance hit of creating a new array, but have since
learned that this is the purpose of asarray. If you decide to do the
log scaling thing, feel free to make these kinds of changes as you
go. The examples dir currently serves as my poor-man's unit testing
framework so you can validate your changes against them.
Note that I made several minor changes to the code last night so be
sure to grab the latest CVS if you want to do any development.