Hi John et al., I just had a chance to play with
> matplotlib for a few minutes, and I'm very encouraged!
Glad to hear it .... keep me informed of bugs and feature requests.
> A feature request: I frequently use Adobe Illustrator to
> touch up postscript files that contain my figures. In this
> case, it is REALLY handy when the postscript files group
> nicely. Knowing little-to-nothing about PostScript and
> Illustrator, I have no idea how hard the behavior is to
> implement, but it would be fantastic if it did.
I know nothing about Illustrator, and have been learning postscript as
I go, so bear with me.
> I just tried a few things with the axes_demo and the
> errorbar_demo in the examples directory. I liked that the
> points grouped together. I didn't like that in the
> errorbar_demo that the points and the errorbars grouped
> together almost inseparably.
What do you mean by "grouped together". I assume this has something
to do with editing in Illustrator, but can you explain in more detail?
Learning (a little bit of) postscript has been a mind opening
experience. I know a lot of programming languages, and postscript
introduced me to several new ideas. It is difficult to take a
(somewhat) state independent OO representation of a graphical object
and translate it into the postscript state machine efficiently,
especially, when the postscript backend has to act like the other
backends at the interface level.
Simple example: suppose you want to draw all the axis tick labels,
each of which has the same font information. The abstract interface
makes a separate call for each label, which causes the postscript
backend to generate the same font information over and over again. A
smart postscript backend keep track of this information so it wouldn't
needlessly regenerate the information leading to file bloat. I would
like to make these improvements, but my first goal was to get
something that works.
Most of the improvements I've envisioned for the PS backend have been
in the realm of file size efficiency (I've seen some damn large PS
files in my day). So I'm interested to get your feedback about these
other areas that I don't yet understand.
> With the demos tested, the primary curve or points grouped
> with a rectangle around the plotting region that had no
> fill or stroke but seemed to clip the contents to within
> that box. I wonder if it would be nicer to produce
> postscript output where the clipping is done before
> rendering to a file, thus eliminating the need for this
> rather strangely behaved box?
Could you also give me some detail here? Is the "box" the rectangular
border of the axes? With regards to a specific demo, what is "the
primary curve" and "rectangle"?
I do use postscript clipping of lines and other objects etc so that
they do not extend beyond the axes borders. Generally, I think this
is *a good thing*. The general organization of matplotlib is figures
contain axes which contain lines, patches and text. Normally, I don't
want lines, patches and text spilling out of their axes containers.
Can you explain a little more what you are trying to achieve in
Illustrator so I can get a better idea of what is missing? What
exactly is the 'strangely behaved box'?
> Also, the generated plots have some two boxes, one with a
> white stroke and one with a white fill, surrounding the
> figure. These, too, seem unnecessary.
Yes, this is a holdover from the GUI. In a GUI presentation, the
plots look nicer with a boundary -- see eg,
where the gray border is the default figure background -- matlab does
this. So the figure (which contains the axes) renders a rectangular
border with a fill color. For the postscript backend, I simply made
these white and when I print on white paper, I never see them. They
can easily be done away with by commenting out the line
in backends/backend_ps.py. I don't really have a problem removing it
entirely as I don't see much need for it in the PS backend, unless
someone wants to frame their plots with background rectangle. I
mainly left it in their for vestigial compatibility with the other
backends. But, so I can get a better understanding of the twisted
mind of Illustrator, could you explain to me what kind of problem this
is causing you?