From: Dan Reinholz <xaenn@ya...> - 2008-06-08 20:49:55
I'm a bit new to pyx (I was previously a gnuplot user)
and have been struggling with this problem for awhile.
I'm working on generating some graphs for calculus,
and I'm trying to illustrate the formal definition of
the limit. In this I want to illustrate a box that
shows which range of x values stays within the error
tolerance. My code is:
from pyx import *
from pyx.graph import axis
return pow((x + 1),3) + 1
a,b,c = 0.5874,1.28943,1
ticksx = [graph.axis.tick.tick(c, label="$x_0$")]
ticksy = [graph.axis.tick.tick(f(a), label="$L -
graph.axis.tick.tick(f(b), label="$L +
g = graph.graphxy(width=8,
x1,y1 = g.pos(a,f(a))
x2,y2 = g.pos(b,f(b))
which works fine except for that I want the box to be
behind the graph rather than on top of it. I've
thought of a few solutions, but haven't been able to
successfully implement any of them (I would actually
love to know how to do all of them, but I don't want
to be too greedy).
1. Knowing how to plot the filled rectangle beneath
the graph would solve the problem.
2. Knowing how to make the fill color transparent.
3. Knowing how to use a different pattern for the fill
so that the graph of the function still shows beneath
If anyone could please show me how to modify my
existing code or otherwise point me in the right
direction, it would be extremely helpful. I am not
very familiar with python, so I imagine syntax is part
of my problem. Many thanks for any help that can be
From: André Wobst <wobsta@us...> - 2008-06-10 06:35:57
you just want g.dolayout() instead of g.finish() ...
by _ _ _ Dr. André Wobst, Amselweg 22, 85716 Unterschleißheim
/ \ \ / ) wobsta@..., http://www.wobsta.de/
/ _ \ \/\/ / PyX - High quality PostScript and PDF figures
(_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/