Dear Alan,

Thanks for your quick response. That cleared things up
perfectly with the Greek letters. I guess it just goes
to show my ignorance of Python. :)

Unfortunately, I wasn't able to use the same trick for
including a fraction as a title. Using the code:

from pyx import *
from pyx.graph import axis

g = graph.graphxy(width=8,
        x=axis.linear(min=1, max=10, title=r"$\tau$"),
        y=axis.linear(title=r"$\frac{1}{2}$"))
        
g.plot(graph.data.function("y(x)=sqrt(0.5*x)/(sqrt(0.5*x)+x)",points=500))
g.finish()
g.writeEPSfile("derivatives_opt_2")

I get the error:

bsd% python derivatives_opt_2.py
Traceback (most recent call last):
  File "derivatives_opt_2.py", line 11, in <module>
    g.finish()
  File
"/usr/local/lib/python2.5/site-packages/pyx/graph/graph.py",
line 268, in finish
    self.doaxes()
  File
"/usr/local/lib/python2.5/site-packages/pyx/graph/graph.py",
line 491, in doaxes
    self.dolayout()
  File
"/usr/local/lib/python2.5/site-packages/pyx/graph/graph.py",
line 475, in dolayout
    self.doaxiscreate(axisname)
  File
"/usr/local/lib/python2.5/site-packages/pyx/graph/graph.py",
line 216, in doaxiscreate
    self.axes[axisname].create()
  File
"/usr/local/lib/python2.5/site-packages/pyx/graph/axis/axis.py",
line 565, in create
    self.canvas = self.axis.create(self.data,
self.positioner, self.graphtexrunner, self.errorname)
  File
"/usr/local/lib/python2.5/site-packages/pyx/graph/axis/axis.py",
line 228, in create
    return _regularaxis._create(self, data,
positioner, graphtexrunner, self.parter, self.rater,
errorname)
  File
"/usr/local/lib/python2.5/site-packages/pyx/graph/axis/axis.py",
line 198, in _create
    variants[0].storedcanvas = layout(variants[0])
  File
"/usr/local/lib/python2.5/site-packages/pyx/graph/axis/axis.py",
line 133, in layout
    self.painter.paint(canvas, data, self, positioner)
    return self.insert(self.texrunner.text_pt(x, y,
atext, *args))
  File
"/usr/local/lib/python2.5/site-packages/pyx/text.py",
line 1222, in text_pt
    return self.text(x * unit.t_pt, y * unit.t_pt,
expr, *args, **kwargs)
  File
"/usr/local/lib/python2.5/site-packages/pyx/text.py",
line 1199, in text
    self.execute(expr,
self.defaulttexmessagesdefaultrun +
self.texmessagesdefaultrun + texmessages)
  File
"/usr/local/lib/python2.5/site-packages/pyx/text.py",
line 1036, in execute
    raise TexResultError("unhandled TeX response
(might be an error)", self)
pyx.text.TexResultError: unhandled TeX response (might
be an error)
The expression passed to TeX was:
  \ProcessPyXBox{\setbox0\hbox{$\vcenter{\vrule
width0pt}$}\PyXDimenVShift=\ht0\setbox0\hbox{{\gdef\PyXBoxHAlign{0.50000}\gdef\PyXFlushHAlign{0.50000}\PyXragged{}$\frac{1}{2}$}}\lower\PyXDimenVShift\box0%
  }{8}%
  \PyXInput{12}%
After parsing the return message from TeX, the
following was left:
  *
  *! Undefined control sequence.
  <recently read> \frac 
                        
  <argument> ...HAlign {0.50000}\PyXragged {}$\frac 
  (cut after 5 lines, increase errordebug for more
output)

Is there any possible fix to use a fraction in my
title, or do I need to seek an alternative formatting
option?

Thanks again,
-Daniel

-----------------

Message: 6
Date: Thu, 17 Jul 2008 19:00:13 -0400
From: Alan G Isaac <[EMAIL PROTECTED]>
Subject: Re: [PyX-user] LaTeX Labels
To: [email protected]
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII

On Thu, 17 Jul 2008, Dan Reinholz apparently wrote:
> title="$\tau$"

Use raw strings:
http://docs.python.org/tut/node5.html#SECTION005120000000000000000

Cheers,
Alan Isaac


      

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to