ยป On Mon, Feb 06, 2006 at 04:57PM +0100, Andre Wobst wrote:
> I was just about to suggest to change the alignment of the title to
> not use the g.pos-feature (which still is a nice feature for certain
> tasks but certainly not for the positioning of a title). But as I see
> now, you already changed that (you could just add g.xpos and g.ypos to
> make your solution working for graphs not originated at (0, 0), but
Yesterday I really had to run...
Here is a (minimal) example of how I normally add a title in Pyx. It's a
sort of a hack but I find it easier than dealing with pyx.text.
BTW... I did appreciate if anyone could tell me of an easy way to keep
the tick marks at the x2 axis without getting tick labels.
Cheers!
Francisco
#! /usr/bin/env python
from pyx import *
from pyx.graph import graphxy, data, axis
WIDTH = 10
XMIN, XMAX =0, 10
xax = axis.linear(min=XMIN, max=XMAX, title=r'$\sin(2x)\sin(x)x$')
xax2 = axis.linear(min=XMIN, max=XMAX, title=r'\Large{Adding Title Example}', parter=None)
yax = axis.linear(title='$y$')
g = graphxy(width=WIDTH, x2=xax2, x=xax, y=yax)
g.plot(graph.data.function("y(x) = sin(2*x)*sin(x)*x", points=300))
g.writeEPSfile(__file__[:-3])
g.writePDFfile(__file__[:-3])