[comp.lang.postscript] scale marks

eckel@marc.ircam.fr (Gerhard Eckel) (05/25/90)

I'm currently writing some function plotting software and I ran into the
problem of drawing scale marks and calculating a good grid size according to
the range used in the function plot. I wonder if anybody did that already in
a general enough way so that I could use it or at least look at it to learn
how to implement this non-trivial but necessary feature of plotting software.

Thanks for any kind of help!

Gerhard Eckel
IRCAM, Paris
eckel@ircam.fr

henry@angel.Sun.COM (Henry McGilton--Desktops Spoke Here) (05/27/90)

In article <1064@ircam.ircam.fr>, eckel@marc.ircam.fr (Gerhard Eckel) writes:

    *  I'm currently writing some function plotting software
    *  and I ran into the problem of drawing scale marks and
    *  calculating a good grid size according to the range
    *  used in the function plot. I wonder if anybody did that
    *  already in a general enough way so that I could use it
    *  or at least look at it to learn how to implement this
    *  non-trivial but necessary feature of plotting software.

Take a look at GRAP -- the graphing preprocessor for PIC (the picture
preprocessor for troff) -- that comes with Documentor's Workbench.

	........  Henry

lee@sq.sq.com (Liam R. E. Quin) (05/28/90)

In article <1064@ircam.ircam.fr>, eckel@marc.ircam.fr (Gerhard Eckel) writes:
> I'm currently writing some function plotting software and I ran into the
> problem of drawing scale marks and calculating a good grid size according to
> the range used in the function plot. I wonder if anybody did that already in
> a general enough way so that I could use it or at least look at it to learn
> how to implement this non-trivial but necessary feature of plotting software.

Henry McGilton--``Desktops Spoke Here'' (henry@angel.Sun.COM)  writes:
> Take a look at GRAP -- the graphing preprocessor for PIC (the picture
> preprocessor for troff) -- that comes with Documentor's Workbench.

Actually grap's scale-drawing heuristic isn't perfect, but it is good
enough to be useful.

The source for a prototype version of grap is included in Jon Bently's books
`Programming Pearls' and `More Programming Pearls', together with excellent
discussions on the issues involved.  (One of the two books is more pertinent
to this than the other, but I forget which, sorry.  Probably the latter.)

Grap itself generates pic instructions, which can then be fed to troff,
whilst the version Jon Bently gives is the original prototype written
in awk (the new awk, often called nawk) which can generate ascii output
for previewing on a tty.  Or at least, that's what I remember.

Lee
-- 
Liam R. E. Quin,  lee@sq.com, {utai,utzoo}!sq!lee,  SoftQuad Inc., Toronto
``When I talk to the people who are the trees that grow in the city...