1.3 + xkcd + latex

This example shows the error on my platform - the xlabel is not rendered with
tex but instead the '$' are printed:

import numpy as np
import matplotlib.pyplot as plt
plt.xkcd()

fig = fig = plt.figure()
ax = fig.add_subplot(111)
plt.plot (np.arange (10), 2*np.arange(10))
ax.set_xlabel ('E\_\{s\}/N\_\{0\}')
plt.show()

Michael Droettboom wrote:

The built-in mathtext support does. (I can put "xkcd()" at the top of
the mathtext_demo.py example and all is well).

It does not work when |text.usetex| is True (when using external TeX).
But in that case, it should have thrown an exception:

>Traceback (most recent call last):
   File "mathtext_demo.py", line 9, in <module>
     xkcd()
   File
   "/home/mdboom/python/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-

linux-x86_64.egg/matplotlib/pyplot.py",

ยทยทยท

   line 293, in xkcd
     "xkcd mode is not compatible with text.usetex = True")
RuntimeError: xkcd mode is not compatible with text.usetex = True|

Mike

On 10/18/2013 07:24 AM, Neal Becker wrote:

It appears that latex doesn't work with xkcd?

I put for example:
         self.ax.set_xlabel ('$E_s/N_0

)

Which go rendered with the '

  signs and not as latex

And my vertical axis was labeled as:

\\mathdefault\{10^\{3\}\} ...

------------------------------------------------------------------------------

October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options