|
From: Jochen V. <vo...@se...> - 2005-02-08 23:42:25
|
Hello,
On Tue, Feb 08, 2005 at 02:45:05PM -0600, John Hunter wrote:
> Actually, I think the right way to do it me to save the x and y arrays
> as postscript arrays, and then generate the postscript for loop to
> iterate over the arrays at postscript render time. ...
> The major feature of postscript that the mpl backend
> currently underutilizes, dare I say almost ignores, is that postscript
> is a programming language. ...
=46rom reading parts of the green book ("PostScript Language Program Design=
")
I gathered the impression that the preferred way of generating PostScript
is to do most of the calculations before writing the PostScript.
Some references from the green book:
p.9: It is better to translate into the PostScript imaging mod-
el than to maintain another set of graphics primitives
using the PostScript language for
p. 80: Remember that the PostScript language is interpreted,
and that it is a programming language only as one
aspect of its design. It is best not to defer calculation
(such as division problems, computing the diameter of a
circle, or figuring the length of some text) to the inter-
preter. Instead, perform these calculations on the host
system as the script is being generated, providing the
data to the procedures in the format expected by the
PostScript language and the individual operators used.
The section "Computation" starting at p. 83 has a similar stance.
The computers matplotlib runs on are probabily many times faster
than the ones built into printers and every PostScript file is
generated only once but potentially printed many times. Therefore
I would rather spend additional CPU cycles in backend_ps.py to
get a compact and computationally simple PostScript file.
Thus I do not think that the "PostScript loop" mentioned above is
a good idea.
> I'll leave it to Jochen to decide on the patch and/or apply it -- on
> my quick read the changes look sensible, and since it passes
> backend_driver, it must be good!
The first version of the patch looked good to me.
Unfortunately I cannot spend any time on this before Thursday.
I suggest that you just apply the patch to CVS and I have
a look at the result on Thursday.
All the best and thank you very much and good night,
Jochen
--=20
http://seehuhn.de/
|