sorry for my late response. I'm really short in time at the moment.
On 08.09.05, Francisco Borges wrote:
> 1. Often I've connected a plotted point with a box of text. Not having a
> box present at the plotted point, I normally insert one like this:
> x0, y0 = g.pos(pto, pto)
> T1 = g.text(x0, y0, " ", text_stl)
> Is there an easier way to get an "empty box"?
Yes. You can use the box module to create rectangular boxes. (There is
a rect class in there. It should fill the bill and help you
I should note, that I'm planing to discuss the whole box system from
scratch again, but overall we want to keep the functionality we have
(and add a lot of things). At the moment boxes are a shabby thing in
PyX. (And that's my fault, since for the moment I just need them
internally and never really thought about the full picture.)
> 2. Not knowing very well how to perform "fills", I've been doing this:
> dt = g.plot(graph.data.function("y(x) = exp(-x)",min=MIN, max=MAX ))#, min=0, max=2*pi))
> g.fill(dt.path, Color)
> My problem is that more than once I want to plot other stuff than the
> filling would cover somehow. I mean I can fix the geometry with dolayout
> and still plot, but then I can't yet fill using the plotted function.
> I've been solving this by using two graphs and inserting one into the
> other. Is there another way to do this?
First, the example you sent, goes into an assert. You may have
commented out this, and this works, since you're not changing the axes
ranges. But its not the proper way of doing things.
The proper way to solve you original issue (at least as far as I
understand it), would be to understand, that you can insert things
below the data and on top of it. To insert something below, you can do
it before g.data is called and to do it afterwards, insert something
after that. Note, that you can insert canvas instances as well. So I
think that's the way to go for you. Suppose you want to stroke
something now on the graph, but is should occur after the data has
been inserted. So just stroke it on a canvas, then add further plot
commands etc. Then finish the graph (or at least call dodata). And
then insert the canvas into the graph. All stuff in the canvas will
then be on top of the data, although you create the material before.
You should not need a second, equal, graph instance.
Beside that I've reworked some graph do-method-dependancies. By that
we can now also add stuff to the graph by the plot method after we
already finished its layout. This will not alter the axes ranges
anymore, but it's an interesting feature for various occations. So,
yes, we already do have various interesting things in the quere for
by _ _ _ Dr. André Wobst
/ \ \ / ) wobsta@..., http://www.wobsta.de/
/ _ \ \/\/ / PyX - High quality PostScript and PDF figures
(_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/