draw_tex NotImplementedError in backend_bases.py

I think I have correctly installed from source. I checked the
dependencies for USETEX and have the right versions for dvipng, gs,
latex, and pdftops. When trying to plot with text.usetex=True I get

<type 'exceptions.NotImplementedError'> Traceback (most recent call last)

/home/william/svn/matplotlib/<ipython console> in <module>()

/usr/lib/python2.5/site-packages/matplotlib/pyplot.py in plot(*args, **kwargs)
   1827 try:
   1828 ret = gca().plot(*args, **kwargs)
-> 1829 draw_if_interactive()
   1830 except:
   1831 hold(b)

/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in
draw_if_interactive()
   1164 figManager = Gcf.get_active()
   1165 if figManager is not None:
-> 1166 figManager.canvas.draw()
   1167
   1168

/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in
draw(self, repaint)
    886 DEBUG_MSG("draw()", 1, self)
    887 self.renderer = RendererWx(self.bitmap, self.figure.dpi)
--> 888 self.figure.draw(self.renderer)
    889 if repaint:
    890 self.gui_repaint()

/usr/lib/python2.5/site-packages/matplotlib/figure.py in draw(self, renderer)
    774
    775 # render the axes
--> 776 for a in self.axes: a.draw(renderer)
    777
    778 # render the figure text

/usr/lib/python2.5/site-packages/matplotlib/axes.py in draw(self,
renderer, inframe)
   1399
   1400 for zorder, i, a in dsu:
-> 1401 a.draw(renderer)
   1402
   1403 renderer.close_group('axes')

/usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self,
renderer, *args, **kwargs)
    678 tick.set_label1(label)
    679 tick.set_label2(label)
--> 680 tick.draw(renderer)
    681 if tick.label1On and tick.label1.get_visible():
    682 extent = tick.label1.get_window_extent(renderer)

/usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self, renderer)
    177
    178 if self.label1On:
--> 179 self.label1.draw(renderer)
    180 if self.label2On:
    181 self.label2.draw(renderer)

/usr/lib/python2.5/site-packages/matplotlib/text.py in draw(self, renderer)
    759 def draw(self, renderer):
    760 self.update_coords(renderer)
--> 761 Text.draw(self, renderer)
    762 if self.get_dashlength() > 0.0:
    763 self.dashline.draw(renderer)

/usr/lib/python2.5/site-packages/matplotlib/text.py in draw(self, renderer)
    307
    308 renderer.draw_tex(gc, x, y, line,
--> 309 self._fontproperties, angle)
    310 return
    311

/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py in
draw_tex(self, gc, x, y, s, prop, angle, ismath)
    264
    265 def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!'):
--> 266 raise NotImplementedError
    267
    268 def draw_text(self, gc, x, y, s, prop, angle, ismath=False):

<type 'exceptions.NotImplementedError'>:

In [4]: ---------------------------------------------------------------------------
<type 'exceptions.NotImplementedError'> Traceback (most recent call last)

/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in
_onPaint(self, evt)
   1018 self.realize()
   1019 # Render to the bitmap
-> 1020 self.draw(repaint=False)
   1021 # Update the display using a PaintDC
   1022 self.gui_repaint(drawDC=wx.PaintDC(self))

/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in
draw(self, repaint)
    886 DEBUG_MSG("draw()", 1, self)
    887 self.renderer = RendererWx(self.bitmap, self.figure.dpi)
--> 888 self.figure.draw(self.renderer)
    889 if repaint:
    890 self.gui_repaint()

/usr/lib/python2.5/site-packages/matplotlib/figure.py in draw(self, renderer)
    774
    775 # render the axes
--> 776 for a in self.axes: a.draw(renderer)
    777
    778 # render the figure text

/usr/lib/python2.5/site-packages/matplotlib/axes.py in draw(self,
renderer, inframe)
   1399
   1400 for zorder, i, a in dsu:
-> 1401 a.draw(renderer)
   1402
   1403 renderer.close_group('axes')

/usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self,
renderer, *args, **kwargs)
    678 tick.set_label1(label)
    679 tick.set_label2(label)
--> 680 tick.draw(renderer)
    681 if tick.label1On and tick.label1.get_visible():
    682 extent = tick.label1.get_window_extent(renderer)

/usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self, renderer)
    177
    178 if self.label1On:
--> 179 self.label1.draw(renderer)
    180 if self.label2On:
    181 self.label2.draw(renderer)

/usr/lib/python2.5/site-packages/matplotlib/text.py in draw(self, renderer)
    759 def draw(self, renderer):
    760 self.update_coords(renderer)
--> 761 Text.draw(self, renderer)
    762 if self.get_dashlength() > 0.0:
    763 self.dashline.draw(renderer)

/usr/lib/python2.5/site-packages/matplotlib/text.py in draw(self, renderer)
    307
    308 renderer.draw_tex(gc, x, y, line,
--> 309 self._fontproperties, angle)
    310 return
    311

/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py in
draw_tex(self, gc, x, y, s, prop, angle, ismath)
    264
    265 def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!'):
--> 266 raise NotImplementedError
    267
    268 def draw_text(self, gc, x, y, s, prop, angle, ismath=False):

<type 'exceptions.NotImplementedError'>:

We are running:
In [4]: matplotlib.__version__
Out[4]: '0.98pre'

with

In [5]: rcParams['text.usetex']=False

In [6]: plot(t,y)
Out[6]: [<matplotlib.lines.Line2D object at 0x9724c2c>]

Does this mean we really didn't successfully build from source? Or is
there some other problem?

Thanks,

Ryan

It looks like you're trying to use the Wx backend, where usetex is not supported.

See here for a matrix of which features are supported with each backend:

http://matplotlib.sourceforge.net/backends.html

Set the backend setting in your matplotlibrc file or call "matplotlib.use" at the top of your script.

Cheers,
Mike

Ryan Krauss wrote:

···

I think I have correctly installed from source. I checked the
dependencies for USETEX and have the right versions for dvipng, gs,
latex, and pdftops. When trying to plot with text.usetex=True I get

<type 'exceptions.NotImplementedError'> Traceback (most recent call last)

/home/william/svn/matplotlib/<ipython console> in <module>()

/usr/lib/python2.5/site-packages/matplotlib/pyplot.py in plot(*args, **kwargs)
   1827 try:
   1828 ret = gca().plot(*args, **kwargs)
-> 1829 draw_if_interactive()
   1830 except:
   1831 hold(b)

/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in
draw_if_interactive()
   1164 figManager = Gcf.get_active()
   1165 if figManager is not None:
-> 1166 figManager.canvas.draw()
   1167
   1168

/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in
draw(self, repaint)
    886 DEBUG_MSG("draw()", 1, self)
    887 self.renderer = RendererWx(self.bitmap, self.figure.dpi)
--> 888 self.figure.draw(self.renderer)
    889 if repaint:
    890 self.gui_repaint()

/usr/lib/python2.5/site-packages/matplotlib/figure.py in draw(self, renderer)
    774
    775 # render the axes
--> 776 for a in self.axes: a.draw(renderer)
    777
    778 # render the figure text

/usr/lib/python2.5/site-packages/matplotlib/axes.py in draw(self,
renderer, inframe)
   1399
   1400 for zorder, i, a in dsu:
-> 1401 a.draw(renderer)
   1402
   1403 renderer.close_group('axes')

/usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self,
renderer, *args, **kwargs)
    678 tick.set_label1(label)
    679 tick.set_label2(label)
--> 680 tick.draw(renderer)
    681 if tick.label1On and tick.label1.get_visible():
    682 extent = tick.label1.get_window_extent(renderer)

/usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self, renderer)
    177
    178 if self.label1On:
--> 179 self.label1.draw(renderer)
    180 if self.label2On:
    181 self.label2.draw(renderer)

/usr/lib/python2.5/site-packages/matplotlib/text.py in draw(self, renderer)
    759 def draw(self, renderer):
    760 self.update_coords(renderer)
--> 761 Text.draw(self, renderer)
    762 if self.get_dashlength() > 0.0:
    763 self.dashline.draw(renderer)

/usr/lib/python2.5/site-packages/matplotlib/text.py in draw(self, renderer)
    307
    308 renderer.draw_tex(gc, x, y, line,
--> 309 self._fontproperties, angle)
    310 return
    311

/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py in
draw_tex(self, gc, x, y, s, prop, angle, ismath)
    264
    265 def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!'):
--> 266 raise NotImplementedError
    267
    268 def draw_text(self, gc, x, y, s, prop, angle, ismath=False):

<type 'exceptions.NotImplementedError'>:

In [4]: ---------------------------------------------------------------------------
<type 'exceptions.NotImplementedError'> Traceback (most recent call last)

/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in
_onPaint(self, evt)
   1018 self.realize()
   1019 # Render to the bitmap
-> 1020 self.draw(repaint=False)
   1021 # Update the display using a PaintDC
   1022 self.gui_repaint(drawDC=wx.PaintDC(self))

/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in
draw(self, repaint)
    886 DEBUG_MSG("draw()", 1, self)
    887 self.renderer = RendererWx(self.bitmap, self.figure.dpi)
--> 888 self.figure.draw(self.renderer)
    889 if repaint:
    890 self.gui_repaint()

/usr/lib/python2.5/site-packages/matplotlib/figure.py in draw(self, renderer)
    774
    775 # render the axes
--> 776 for a in self.axes: a.draw(renderer)
    777
    778 # render the figure text

/usr/lib/python2.5/site-packages/matplotlib/axes.py in draw(self,
renderer, inframe)
   1399
   1400 for zorder, i, a in dsu:
-> 1401 a.draw(renderer)
   1402
   1403 renderer.close_group('axes')

/usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self,
renderer, *args, **kwargs)
    678 tick.set_label1(label)
    679 tick.set_label2(label)
--> 680 tick.draw(renderer)
    681 if tick.label1On and tick.label1.get_visible():
    682 extent = tick.label1.get_window_extent(renderer)

/usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self, renderer)
    177
    178 if self.label1On:
--> 179 self.label1.draw(renderer)
    180 if self.label2On:
    181 self.label2.draw(renderer)

/usr/lib/python2.5/site-packages/matplotlib/text.py in draw(self, renderer)
    759 def draw(self, renderer):
    760 self.update_coords(renderer)
--> 761 Text.draw(self, renderer)
    762 if self.get_dashlength() > 0.0:
    763 self.dashline.draw(renderer)

/usr/lib/python2.5/site-packages/matplotlib/text.py in draw(self, renderer)
    307
    308 renderer.draw_tex(gc, x, y, line,
--> 309 self._fontproperties, angle)
    310 return
    311

/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py in
draw_tex(self, gc, x, y, s, prop, angle, ismath)
    264
    265 def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!'):
--> 266 raise NotImplementedError
    267
    268 def draw_text(self, gc, x, y, s, prop, angle, ismath=False):

<type 'exceptions.NotImplementedError'>:

We are running:
In [4]: matplotlib.__version__
Out[4]: '0.98pre'

with

In [5]: rcParams['text.usetex']=False

In [6]: plot(t,y)
Out[6]: [<matplotlib.lines.Line2D object at 0x9724c2c>]

Does this mean we really didn't successfully build from source? Or is
there some other problem?

Thanks,

Ryan

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

I think I have correctly installed from source. I checked the
dependencies for USETEX and have the right versions for dvipng, gs,
latex, and pdftops. When trying to plot with text.usetex=True I get

[...]

Does this mean we really didn't successfully build from source? Or is
there some other problem?

I think it means you need to use the wxagg backend rather than wx. Is that a
possibility?

Darren

···

On Wednesday 26 March 2008 11:20:46 am Ryan Krauss wrote: