From: Benjamin R. <ben...@ou...> - 2010-08-02 14:51:23
|
Hmmm, if I comment out the .savefig() and use the show(), I get no errors. But I get the same key error if I try to save it as a pdf. However, if I save it as a png, I get no problems. Maybe it is a problem with the pdf backend? Ben Root On Mon, Aug 2, 2010 at 9:29 AM, Richard Lincoln <r.w...@gm...>wrote: > On 2 August 2010 15:19, Darren Dale <dsd...@gm...> wrote: > > On Mon, Aug 2, 2010 at 10:15 AM, Richard Lincoln <r.w...@gm...> > wrote: > >> I am having trouble creating a plot using TeX which has a $ sign in > >> one of the axis labels. If I run: > >> > >> import matplotlib > >> > >> matplotlib.rc('font', **{'family': 'serif', 'serif': ['Computer Modern > Roman']}) > >> matplotlib.rc('text', usetex=True) > >> > >> import pylab > >> > >> pylab.figure() > >> pylab.plot([0.0, 1.0]) > >> pylab.ylabel("Profit (\$)") > >> pylab.savefig('/tmp/fig.pdf') > >> > >> > >> I get the error: > > > > Try: > > > > pylab.ylabel(r"Profit (\$)") > > > > No luck. Nor with: > > matplotlib.rc('text.latex', unicode=True) > pylab.ylabel(u"Profit (\$)") > > > ------------------------------------------------------------------------------ > The Palm PDK Hot Apps Program offers developers who use the > Plug-In Development Kit to bring their C/C++ apps to Palm for a share > of $1 Million in cash or HP Products. Visit us here for more details: > http://p.sf.net/sfu/dev2dev-palm > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |