[reportlab-users] Re: Plotting with logarithmic axes

Dinu Gherman reportlab-users@reportlab.com
Wed, 30 Jul 2003 15:03:05 +0200


Robin Becker:

> Dinu and Andy originally decided against arguments for some reason, =
but
> Andy has now come round to the opposite view and has made a sort of
> giant factory function (at least for simple excel like charts).

Ok, I claim, I'm also changing opinions when things can be improved.
;-) (I just thought about implementing a special variety of RL-bar-
charts and got really mad about it... so I sort of needed the follow-
ing little distraction.)

A short verification shows that Mathematica also has half a dozen or
more *Log*Plot() functions. That's ok as an abbreviation for inter-
active use, but as a general API I don't really like it.

Looking at Gnuplot, which can also be very interactive, you'll find
the commands "set/unset logscale" which I find more useful in this
context.

If you play a little bit with it you can quickly write a ReportLab-
Graphics wrapper like I did to produce diagrams like these (making
also use of my svglib module):

   http://python.net/~gherman/tmp/lin_exp_x.pdf
   http://python.net/~gherman/tmp/log_exp_x.pdf

Gnuplot also writes PDF directly (using pdflib), but if you write
your own wrapper you can reuse Gnuplot charts in your own RL docs,
possibly really complicated ones like many on this page:

   http://warmada.pandu.org/Graphics/gallery

Regards,

Dinu

--
Dinu C. Gherman
......................................................................
"I=A0love=A0America=A0more=A0than=A0any=A0other=A0country=A0in=A0this=A0wo=
rld,=A0and,
exactly=A0for=A0this=A0reason,=A0I=A0insist=A0on=A0the=A0right=A0to=A0crit=
icize=A0her
perpetually." (James=A0Baldwin)