Latex \partial

I am a newbie in matplotlib. I want to use the following label (in latex)
\langle \partial_x U(x) \rangle.
When i use
           ylabel(r"$\langle \partial_x U(x) \rangle$",fontsize=30);
matplotlib complains by saying

     Traceback (most recent call last):
"/usr/lib/python2.3/site-packages/matplotlib/backends/", line
277, in expose_event
    self._render_figure(width, height)
line 91, in _render_figure
"/usr/lib/python2.3/site-packages/matplotlib/backends/", line
369, in draw
  File "/usr/lib/python2.3/site-packages/matplotlib/", line 498, in
    for a in self.axes: a.draw(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/", line 1362, in
  File "/usr/lib/python2.3/site-packages/matplotlib/", line 578, in
    self.label.draw(renderer) # memory leak here, vertical text
  File "/usr/lib/python2.3/site-packages/matplotlib/", line 334, in
    bbox, info = self._get_layout(renderer)
  File "/usr/lib/python2.3/site-packages/matplotlib/", line 179, in
    w,h = renderer.get_text_width_height(
"/usr/lib/python2.3/site-packages/matplotlib/backends/", line
242, in get_text_width_height
    width, height, fonts = math_parse_s_ft2font(
  File "/usr/lib/python2.3/site-packages/matplotlib/", line 1222,
in math_parse_s_ft2font
    handler.expr.set_size_info(fontsize, dpi)
  File "/usr/lib/python2.3/site-packages/matplotlib/", line 870,
in set_size_info
    self.elements[0].set_size_info(self._scale*fontsize, dpi)
  File "/usr/lib/python2.3/site-packages/matplotlib/", line 795,
in set_size_info
    Element.set_size_info(self, fontsize, dpi)
  File "/usr/lib/python2.3/site-packages/matplotlib/", line 708,
in set_size_info
    element.set_size_info(self.fontsize, dpi)
  File "/usr/lib/python2.3/site-packages/matplotlib/", line 796,
in set_size_info
    self.metrics = Element.fonts.get_metrics(
  File "/usr/lib/python2.3/site-packages/matplotlib/", line 409,
in get_metrics
    cmfont, metrics, glyph, offset = \
  File "/usr/lib/python2.3/site-packages/matplotlib/", line 429,
in _get_info
    raise ValueError('unrecognized symbol "%s"' % sym)
ValueError: unrecognized symbol "\partial"

  I searched the forum for something similar and could not find anything.
Also my latex can typeset the above if i run it in a separate tex file. I
am using the GTKAgg backend.

Could someone please help me out?



View this message in context:\partial-tf2963980.html#a8292755
Sent from the matplotlib - users mailing list archive at