|
From: Andre W. <wo...@us...> - 2006-06-23 17:30:19
|
Hi,
On 16.06.06, trevorw wrote:
> If I read the documentation correctly I should use a texter to define
> fonts for axis labels.
This is one posibility for regular axes. The point is that the texter
can add attributes to be used to typeset the labels. This is
important, since the texter for example might use mathematics (they
even always force the mathmode by default). And somehow this mathmode
attribute needs to be set.
Still other attributes can be set in the graph painter. Its labelattrs
for regular axes painters.
> However, graph.bar.axis doesn't have a texter, so
> how can I change fonts?
>
> In the case of the minimal example
>
> from pyx import *
>
> inserting these lines
> text.set(mode="latex")
> text.preamble(r"\usepackage{helvet}"}
>
> g = graph.graphxy(width=8, x=graph.axis.bar())
> g.plot(graph.data.file("minimal.dat", xname=0, y=2),
> [graph.style.bar()]) g.writeEPSfile("minimal")
> g.writePDFfile("minimal")
>
> has no effect whatsoever on the final output.
>
> ?
For bar axes there are no texters. Right. But there is still an
similar feature like labelattrs, namely nameatts. (To differentiate
between discrete and continous axes I've used labels vs. names in
regular vs. discrete axes.)
HTH,
André
--
by _ _ _ Dr. André Wobst
/ \ \ / ) wo...@us..., http://www.wobsta.de/
/ _ \ \/\/ / PyX - High quality PostScript and PDF figures
(_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/
|