Sheesh it's been a weird day. I failed to reply to the whole list. 

Jouni, sorry about the duplciate message...




> <phob...@geosyntec.com> writes:
> > |C:\Documents and Settings\phobson>ipython26 -pylab
>
> From: Jouni K. Seppänen [mailto:j...@iki.fi] Could you try this in 
> plain Python? I'm asking because you seem to be getting an IPython 
> warning about a possibly corrupted traceback:
> 
> > ERROR: An unexpected error occurred while tokenizing input The 
> > following traceback may be corrupted or invalid The error message 
> > is: ('EOF in multi-line statement', (550, 0))
> 
> I suggest you write your commands in a script and run it with
> 
> python script.py --verbose-debug

Jouni: Thanks for the prompt reply. I did just that. Calling the script both 
ways (w/ and w/o the PDF backend) fails with a lot of out. This time I've 
included the verbose output as an attached text file. I apologize of that's a 
mailing list faux pas. Here's the code for the script, pyTest.py:

import pylab as pl
x = pl.arange(6)
y = x + 5
pl.plot(x,y,'ko', zorder=10)
pl.xlabel('X-label, no TeX')
pl.ylabel('Y-label. no math')
pl.savefig('no_math.png')
pl.savefig('no_math.pdf')

pl.xlabel(r'some math: $\tau_{y}$')
pl.savefig('some_math.png')
pl.savefig('some_math.pdf')
# EOF

no_math.* and some_math.png are created just fine. The error occurred trying to 
create some_math.pdf.

I'm really at a loss b/c I could swear I created fairly complex figures with 
output to PDF about a week ago and don't recall changing my Python or MPL 
installation.

> so that we can get a better picture of where it is going wrong.
> 
> Also, does it matter that you are using Qt4Agg? You can test this by 
> trying

Both seemed to provide the same error message, so I've only included the 
verbose output from C:\Python25>python c:\GDAG2009\python\pyTest.py -d pdf 
--verbose-debug

For grins and giggles, I went to my matplotlibrc file and commented out the 
lines telling MPL to use Droid fonts (even though they never gave me a problem 
before). That didn't change anything.

Thanks again,
-paul
C:\Python25>python c:\GDAG2009\python\pyTest.py -d pdf --verbose-debug
$HOME=C:\Documents and Settings\phobson
CONFIGDIR=C:\Documents and Settings\phobson\.matplotlib
matplotlib data path C:\Python25\lib\site-packages\matplotlib\mpl-data
loaded rc file C:\Documents and Settings\phobson\.matplotlib\matplotlibrc
matplotlib version 0.99.1
verbose.level debug
interactive is False
units is False
platform is win32
loaded modules: ['numpy.lib._iotools', 'xml.sax.urlparse', 'distutils', 
'matplotlib.errno', 'pylab', 'subprocess', 'gc', 'matplotl
ib.tempfile', 'distutils.sysconfig', 'ctypes._endian', 'encodings.encodings', 
'matplotlib.colors', 'msvcrt', 'numpy.testing.sys',
'numpy.core.info', 'xml', 'numpy.fft.types', 'numpy.ma.operator', 
'numpy.ma.cPickle', 'struct', 'numpy.random.info', 'tempfile', '
xml.sax.urllib', 'numpy.linalg', 'matplotlib.threading', 
'numpy.testing.operator', 'imp', 'numpy.testing', 'collections', 'numpy.c
ore.umath', '_struct', 'distutils.types', 'numpy.lib.numpy', 
'numpy.core.scalarmath', 'matplotlib.matplotlib', 'string', 'matplotl
ib.subprocess', 'numpy.testing.os', 'matplotlib.locale', 
'numpy.lib.arraysetops', 'numpy.testing.unittest', 'numpy.lib.math', 'mat
plotlib.__future__', 'numpy.testing.re', 'itertools', 'numpy.version', 
'numpy.lib.re', 'distutils.re', 'ctypes.os', 'numpy.core.os
', 'numpy.lib.type_check', 'numpy.lib.__builtin__', 'signal', 
'numpy.lib.types', 'numpy.lib._datasource', 'random', 'threading', '
token', 'numpy.fft.fftpack_lite', 'matplotlib.cbook', 'ctypes.ctypes', 
'xml.sax.xmlreader', 'numpy.__builtin__', 'dis', 'distutils
.version', 'cStringIO', 'numpy.ma.core', 'numpy.numpy', 'matplotlib.StringIO', 
'locale', 'numpy.add_newdocs', 'numpy.lib.getlimits
', 'xml.sax.saxutils', 'matplotlib.numpy', 'numpy.lib.sys', 'encodings', 
'numpy.ma.itertools', 'numpy.lib.io', 'numpy.ma.extras',
'numpy.testing.decorators', 'matplotlib.warnings', 'matplotlib.string', 
'_subprocess', 'urllib', 'matplotlib.sys', 're', 'numpy.li
b._compiled_base', 'ntpath', 'new', 'numpy.random.mtrand', 'math', 
'numpy.fft.helper', 'numpy.ma.warnings', 'inspect', 'numpy.ma.i
nspect', 'UserDict', 'numpy.lib.function_base', 'distutils.os', 'matplotlib', 
'numpy.fft.numpy', 'numpy.lib.ufunclike', 'numpy.lib
.info', 'numpy.core.numerictypes', 'ctypes', 'numpy.lib.warnings', 
'ctypes.struct', 'codecs', 'numpy.core._sort', 'numpy.os', '_lo
cale', 'matplotlib.sre_constants', 'matplotlib.os', 'thread', 'StringIO', 
'numpy.core.memmap', 'traceback', 'weakref', 'numpy.core
._internal', 'numpy.fft.fftpack', 'opcode', 'numpy.linalg.lapack_lite', 
'distutils.sys', 'os', 'numpy.lib.itertools', '__future__'
, 'matplotlib.copy', 'xml.sax.types', 'matplotlib.traceback', '_sre', 
'unittest', 'numpy.core.sys', 'numpy.random', 'numpy.linalg.
numpy', '__builtin__', 'numpy.lib.twodim_base', 'matplotlib.re', 
'numpy.core.cPickle', 'operator', 'numpy.core.arrayprint', 'distu
tils.string', 'numpy.lib.arrayterator', 'ctypes._ctypes', 'ctypes.sys', 
'matplotlib.datetime', 'numpy.testing.nosetester', 'numpy.
lib.financial', 'numpy.core.multiarray', 'errno', '_socket', 'binascii', 
'sre_constants', 'datetime', 'numpy.ma', 'xml.sax.handler
', 'types', 'tokenize', 'numpy.lib.stride_tricks', 'numpy.core.numpy', 'numpy', 
'matplotlib.types', 'numpy.core.defmatrix', 'xml.s
ax.os', 'cPickle', 'matplotlib.xml', '_codecs', 'numpy.lib.operator', 
'encodings.cp1252', 'matplotlib.pyparsing', 'nturl2path', 'n
umpy.ma.numpy', 'copy', 'numpy.core.re', 'socket', '_types', 
'numpy.core.fromnumeric', 'numpy.ctypeslib', 'numpy.lib.scimath', 'nu
mpy.fft', 'numpy.lib', 'numpy.random.numpy', 'encodings.aliases', 
'matplotlib.distutils', 'exceptions', 'sre_parse', 'numpy.core.c
StringIO', 'numpy.core.ctypes', 'distutils.distutils', 'copy_reg', 
'sre_compile', 'xml.sax', '_random', 'numpy.lib.__future__', 's
ite', 'numpy.lib.polynomial', 'numpy._import_tools', 'numpy.core.copy_reg', 
'zipimport', '__main__', 'numpy.fft.info', 'numpy.core
.records', 'shutil', 'numpy.lib.cPickle', 'numpy.sys', 'matplotlib.weakref', 
'numpy.core._dotblas', 'numpy.testing.traceback', 'st
rop', 'numpy.testing.numpytest', 'numpy.core.numeric', 'numpy.linalg.info', 
'encodings.codecs', 'numpy.ctypes', 'numpy.core', 'mat
plotlib.rcsetup', 'matplotlib.time', 'nt', 'xml.sax._exceptions', 
'xml.sax.codecs', 'stat', '_ssl', 'numpy.lib.utils', 'numpy.lib.
index_tricks', 'warnings', 'encodings.types', 'numpy.core.defchararray', 
'_ctypes', 'numpy.lib.shape_base', 'numpy.core.types', 's
ys', 'numpy.core.warnings', 'numpy.core.__builtin__', 'xml.sax.sys', 
'numpy.lib.format', 'numpy.lib.os', 'numpy.__config__', 'os.p
ath', 'numpy.lib.shutil', 'matplotlib.fontconfig_pattern', '_weakref', 
'distutils.errors', 'urlparse', 'linecache', 'matplotlib.sh
util', 'numpy.lib.cStringIO', 'time', 'numpy.lib.machar', 
'numpy.linalg.linalg', 'numpy.testing.utils']
Using fontManager instance from C:\Documents and 
Settings\phobson\.matplotlib\fontList.cache
backend Qt4Agg version 0.9.1
findfont: Matching 
:family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0
 to Droid Sans (C:\WINDOWS
\Fonts\DroidSans.ttf) with score of 0.000000
Assigning font /F1 = C:\WINDOWS\Fonts\DroidSans.ttf
Embedding font C:\WINDOWS\Fonts\DroidSans.ttf
Writing TrueType font
findfont: Matching 
:family=STIXGeneral:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0
 to STIXGeneral (C:\Pytho
n25\lib\site-packages\matplotlib\mpl-data\fonts\ttf\STIXGeneral.ttf) with score 
of 0.000000
findfont: Matching 
:family=STIXNonUnicode:style=normal:variant=normal:weight=bold:stretch=normal:size=10.0
 to STIXNonUnicode (C:\P
ython25\lib\site-packages\matplotlib\mpl-data\fonts\ttf\STIXNonUniBol.ttf) with 
score of 0.000000
findfont: Matching 
:family=STIXGeneral:style=normal:variant=normal:weight=bold:stretch=normal:size=10.0
 to STIXGeneral (C:\Python2
5\lib\site-packages\matplotlib\mpl-data\fonts\ttf\STIXGeneralBol.ttf) with 
score of 0.000000
findfont: Matching 
:family=STIXSize3:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0
 to STIXSize3 (C:\Python25\
lib\site-packages\matplotlib\mpl-data\fonts\ttf\STIXSiz3Sym.ttf) with score of 
0.000000
findfont: Matching 
:family=STIXSize4:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0
 to STIXSize4 (C:\Python25\
lib\site-packages\matplotlib\mpl-data\fonts\ttf\STIXSiz4Sym.ttf) with score of 
0.000000
findfont: Matching 
:family=STIXSize5:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0
 to STIXSize5 (C:\Python25\
lib\site-packages\matplotlib\mpl-data\fonts\ttf\STIXSiz5Sym.ttf) with score of 
0.000000
findfont: Matching 
:family=STIXSize1:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0
 to STIXSize1 (C:\Python25\
lib\site-packages\matplotlib\mpl-data\fonts\ttf\STIXSiz1Sym.ttf) with score of 
0.000000
findfont: Matching 
:family=STIXSize2:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0
 to STIXSize2 (C:\Python25\
lib\site-packages\matplotlib\mpl-data\fonts\ttf\STIXSiz2Sym.ttf) with score of 
0.000000
findfont: Matching 
:family=STIXGeneral:style=italic:variant=normal:weight=normal:stretch=normal:size=10.0
 to STIXGeneral (C:\Pytho
n25\lib\site-packages\matplotlib\mpl-data\fonts\ttf\STIXGeneralItalic.ttf) with 
score of 0.000000
findfont: Matching 
:family=STIXNonUnicode:style=italic:variant=normal:weight=normal:stretch=normal:size=10.0
 to STIXNonUnicode (C:
\Python25\lib\site-packages\matplotlib\mpl-data\fonts\ttf\STIXNonUniIta.ttf) 
with score of 0.000000
findfont: Matching 
:family=STIXNonUnicode:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0
 to STIXNonUnicode (C:
\Python25\lib\site-packages\matplotlib\mpl-data\fonts\ttf\STIXNonUni.ttf) with 
score of 0.000000
Assigning font /F1 = C:\WINDOWS\Fonts\DroidSans.ttf
Assigning font /F2 = 
C:\Python25\lib\site-packages\matplotlib\mpl-data\fonts\ttf\STIXNonUniIta.ttf
Assigning font /F3 = 
C:\Python25\lib\site-packages\matplotlib\mpl-data\fonts\ttf\STIXGeneralItalic.ttf
Traceback (most recent call last):
  File "c:\GDAG2009\python\pyTest.py", line 12, in <module>
    pl.savefig('some_math.pdf')
  File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 356, in 
savefig
    return fig.savefig(*args, **kwargs)
  File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 1032, in 
savefig
    self.canvas.print_figure(*args, **kwargs)
  File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4agg.py", 
line 144, in print_figure
    FigureCanvasAgg.print_figure(self, *args, **kwargs)
  File "C:\Python25\Lib\site-packages\matplotlib\backend_bases.py", line 1476, 
in print_figure
    **kwargs)
  File "C:\Python25\Lib\site-packages\matplotlib\backend_bases.py", line 1334, 
in print_pdf
    return pdf.print_pdf(*args, **kwargs)
  File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_pdf.py", line 
2025, in print_pdf
    self.figure.draw(renderer)
  File "C:\Python25\Lib\site-packages\matplotlib\artist.py", line 46, in 
draw_wrapper
    draw(artist, renderer, *kl)
  File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 773, in draw
    for a in self.axes: a.draw(renderer)
  File "C:\Python25\Lib\site-packages\matplotlib\artist.py", line 46, in 
draw_wrapper
    draw(artist, renderer, *kl)
  File "C:\Python25\Lib\site-packages\matplotlib\axes.py", line 1735, in draw
    a.draw(renderer)
  File "C:\Python25\Lib\site-packages\matplotlib\artist.py", line 46, in 
draw_wrapper
    draw(artist, renderer, *kl)
  File "C:\Python25\Lib\site-packages\matplotlib\axis.py", line 757, in draw
    self.label.draw(renderer)
  File "C:\Python25\Lib\site-packages\matplotlib\text.py", line 565, in draw
    ismath=ismath)
  File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_pdf.py", line 
1516, in draw_text
    if ismath: return self.draw_mathtext(gc, x, y, s, prop, angle)
  File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_pdf.py", line 
1378, in draw_mathtext
    self.file.output(self.encode_string(unichr(num), fonttype), Op.show)
ValueError: unichr() arg not in range(0x10000) (narrow Python build)
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to