Hi,

I think there is a bug in the pdf backend (png-files save ok) that makes plots crash when they contain a marker.

The attached script crashes on the last savefig. I have also attached a traceback.

I run matplotlib-svn-4904 on windows with python 2.4

/Jörgen

Traceback (most recent call last):
  File "loglog_bug.py", line 13, in ?
    pylab.savefig("slask2.pdf")
  File 
"c:\python\external\matplotlib\build\lib.win32-2.4\matplotlib\pyplot.py", line 
271, in savefig
    return fig.savefig(*args, **kwargs)
  File 
"c:\python\external\matplotlib\build\lib.win32-2.4\matplotlib\figure.py", line 
854, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File 
"c:\python\external\matplotlib\build\lib.win32-2.4\matplotlib\backend_bases.py",
 line 1084, in print_figure
    orientation=orientation,
  File 
"c:\python\external\matplotlib\build\lib.win32-2.4\matplotlib\backend_bases.py",
 line 994, in print_pdf
    return pdf.print_pdf(*args, **kwargs)
  File 
"c:\python\external\matplotlib\build\lib.win32-2.4\matplotlib\backends\backend_pdf.py",
 line 1865, in print_pdf
    file.close()
  File 
"c:\python\external\matplotlib\build\lib.win32-2.4\matplotlib\backends\backend_pdf.py",
 line 438, in close
    self.writeMarkers()
  File 
"c:\python\external\matplotlib\build\lib.win32-2.4\matplotlib\backends\backend_pdf.py",
 line 1081, in writeMarkers
    self.writePath(path, trans)
  File 
"c:\python\external\matplotlib\build\lib.win32-2.4\matplotlib\backends\backend_pdf.py",
 line 1114, in writePath
    cmds = self.pathOperations(path, transform)
  File 
"c:\python\external\matplotlib\build\lib.win32-2.4\matplotlib\backends\backend_pdf.py",
 line 1093, in pathOperations
    for points, code in tpath.iter_segments():
  File "c:\python\external\matplotlib\build\lib.win32-2.4\matplotlib\path.py", 
line 201, in iter_segments
    num_vertices = NUM_VERTICES[code]
TypeError: list indices must be integers
import pylab,matplotlib
from numpy import array,arange,pi,sin,cos

x=arange(0,2*pi,0.1)

pylab.figure(1)
pylab.clf()
pylab.plot(x,sin(x),"r-")
pylab.savefig("slask1.png")
pylab.savefig("slask1.pdf")
pylab.plot(x, cos(x),"bx")
pylab.savefig("slask2.png")
pylab.savefig("slask2.pdf")

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to