#18 Axis labels look weird


When I create an XY graph and specify an axis label that is more than one word long, sometimes the
two words overlap. Here is ahat I have found so far:
(Axis label specified: What it looks like)

"X values" - Looks normal
"Y values" - Looks normal
"solution variable" - Two words overlap
"variable" - Looks normal
"variableABCDEFGHIJ" - Looks normal
"variable ABCDEFGHIJ" - Looks like: variablCDEF GHIJ (where the indicates where the "e" and
"AB" overlap)
"solution-variable" - Looks normal
"solution_variable" - Gives the following error:
Traceback (most recent call last):
File "/users/mont/PyX-0.6.3/pyx/canvas.py", line 367, in writeEPSfile
abbox = bbox is not None and bbox or self.bbox()
File "/users/mont/PyX-0.6.3/pyx/canvas.py", line 129, in bbox
abbox = cmd.bbox()
File "/users/mont/PyX-0.6.3/pyx/deco.py", line 71, in bbox
pbbox = self.path.bbox()
File "/users/mont/PyX-0.6.3/pyx/graph/graph.py", line 418, in bbox
File "/users/mont/PyX-0.6.3/pyx/graph/graph.py", line 368, in finish
File "/users/mont/PyX-0.6.3/pyx/graph/graph.py", line 310, in dolayout
File "/users/mont/PyX-0.6.3/pyx/graph/axis/axis.py", line 344, in finish
ac = self.painter.paint(axispos, self)
File "/users/mont/PyX-0.6.3/pyx/graph/axis/painter.py", line 486, in paint
title.paint(self, axispos, axis, ac=ac)
File "/users/mont/PyX-0.6.3/pyx/graph/axis/painter.py", line 305, in paint
title = self.texrunner.text_pt(x, y, axis.title, titleattrs)
File "/users/mont/PyX-0.6.3/pyx/text.py", line 1133, in text_pt
return self.text(unit.t_pt(x), unit.t_pt(y), expr, args, kwargs)
File "/users/mont/PyX-0.6.3/pyx/text.py", line 1115, in text
self.execute(expr, self.defaulttexmessagesdefaultrun + self.texmessagesdefaultrun + texmessages)
File "/users/mont/PyX-0.6.3/pyx/text.py", line 944, 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:
After parsing the return message from TeX, the following was left:

! Missing $ inserted.<inserted text=""> $<to be="" read="" again="">
...h0pt}$}\lower \ht 0\hbox {{solution_
variable}}\ProcessPyXBox #1#2->\setbox \PyXBox =\hbox {{#1
}}\PyXDimenHAlignLT =\PyXHAl...<> }{53} %!
Extra }, or forgotten $.<argument> ...ower \ht 0\hbox {{solution_variable}

}\ProcessPyXBox #1#2->\setbox \PyXBox =\hbox {{#1
}}\PyXDimenHAlignLT =\PyXHAl...<
> }{53} %! Extra }, or forgotten
$.<argument> ...wer \ht 0\hbox {{solution_variable}}
\ProcessPyXBox #1#2->\setbox \PyXBox =\hbox {{#1
}}\PyXDimenHAlignLT =\PyXHAl...<> }{53} %! Extra }, or forgotten
$.\ProcessPyXBox #1#2->\setbox \PyXBox =\hbox {{#1}

}\PyXDimenHAlignLT =\PyXHAl...<
> }{53}
%! Extra }, or forgotten $.\ProcessPyXBox #1#2->\setbox \PyXBox =\hbox {{#1}}
\PyXDimenHAlignLT =\PyXHAl...<*> }{53}

My e-mail address is alexander.mont@nist.gov


  • Gert Ingold

    Gert Ingold - 2004-07-07

    Logged In: YES

    I cannot reproduce the problem with "variable ABCDEFGHIJ" under
    PyX 0.6.3. Do you have a minimal example?

    The problem with "solution_variable" is not a PyX bug but
    to TeX which expects the underscore in math mode where it would
    indicate a subscript (see also FAQ 4.3.3). To avoid this
    the underscore has to be escaped with a backslash, i.e. you
    use "solution_variable". See also FAQ 2.4 concerning the use
    of raw strings in Python.

  • Andre Wobst

    Andre Wobst - 2004-07-07

    Logged In: YES

    I expect this problem to be related to the text output itself. Could you try
    to run hello.py, which can be found at the example directory. You may
    substitute the string "hello, world!" by something you used before
    ("variable ABCDEFGHIJ") to reproduce your problem. In case you find the
    same behaviour it would be a much better suitable (e.g. minimal)
    example to further investigate your problem.

  • Andre Wobst

    Andre Wobst - 2004-08-27

    Logged In: YES

    We can't reproduce this bug. I'm closing it for the moment.
    Please reopen it to provide us with further information.


Log in to post a comment.