Hi Mike,
the error only occurs if the output file is specified as a file(-like)
object instead of a file name. This is necessary for me in order to add
a matplotlib-generated file to a tar archive via a safe temporary file.
Greetings,
Dieter
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import matplotlib
import matplotlib.pyplot as pp
import tempfile
import cStringIO as StringIO
matplotlib.rcParams['svg.embed_char_paths'] = False
pp.plot([1, 2], [1, 2], label=u"äöü")
pp.legend()
# works
pp.savefig('test.svg')
# breaks
with open('test2.svg', 'wb') as ofile:
pp.savefig(ofile, format='svg')
# breaks
ostr = StringIO.StringIO()
pp.savefig(ostr, format='svg')
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel