PyXPlot renders all text labels automatically in the LaTeX typesetting environment. This brings many advantages: it produces neater labels than the default typesetting engine used by Gnuplot, makes it straightforward to label graphs with mathematical expressions, and moreover makes it straightforward when importing graphs into LaTeX documents to match the fonts used in figures with those used in the main text of the document. It does, however, also necessarily introduce some incompatibility with Gnuplot. Some strings which are valid in Gnuplot are not valid in PyXPlot (see Section 3.6 for more details). For example,
|
set xlabel ’x ![]() |
is a valid label in Gnuplot, but is not valid input for LaTeX and therefore fails in PyXPlot. In PyXPlot, it needs to be written in LaTeX mathmode as:
|
set xlabel ’$x ![]() |
A useful introduction to LaTeX’s syntax can be found in Tobias Oetiker’s excellent free tutorial, The Not So Short Guide to LaTeX , which is available for free download from:
http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf
PyXPlot’s built-in texify() function can also assist by automatically converting mathematical expressions and strings of text into LaTeX, as in the following examples:
pyxplot> a=50
pyxplot> print texify("A %d% increase"%(a))
A 50% increase
pyxplot> print texify(sqrt(x**2+1))
$
displaystyle sqrt{x
{2}+1}$