[Matrix-SIG] algorithm for intelligent axis scaling?

Roger Burnham rburnham@cri-inc.com
Thu, 18 Mar 1999 12:48:58 -800

On 18 Mar 99, at 11:47, Alexander Lawhead mused:

> This is not directly a NumPy question, but I figured that the best answer
> might come from this group. :) I'm looking for a simple algorithm for
> generating intelligent axis scalings for a graph. Basically what I need is
> the axis minimum, axis maximum, and step length between ticks given the
> minimum data value, maximum data value, and suggested number of ticks.
> By intelligent, I mean reasonably intuitive rounding for the axis labels!
> This should be easy, but I'm afraid I've been spoiled by automagical
> plotting in countless canned graphics packages. Any help would be
> appreciated.

Just today, I downloaded Richard Jones' PILGraph 0.1 package that was recently 
announced on c.l.p.  Available at


It has just such an algo.


Roger Burnham   
Cambridge Research & Instrumentation   
PGP Key: http://www.nai.com/default_pgp.asp   
PGP Fingerprint: 5372 729A 9557 5F36 177F  084A 6C64 BE27 0BC4 CF2D