Problem plotting interactively from PyCrust

Hello,

I'm running the latest matplotlib (and wxPython) with Python 2.5.2 on Win
XP. Everything works fine, the plotting quality is excellent, and
interactive plotting works nicely with IPython.

However, I much prefer the PyCrust interactive terminal and use it a lot. I
tried following the directions
(http://matplotlib.sourceforge.net/interactive.html) for interactive
plotting from PyCrust:

  >>> import matplotlib
  >>> matplotlib.interactive(True)
  >>> matplotlib.use('WX')
  >>> from matplotlib.pylab import *
  >>> plot([1,2,3])
  >>> xlabel('time (s)')

Unfortunately, this does not work. After I call "plot", an empty plot window
appears and the following is printed:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 1947, in
plot
    b = ishold()
  File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 396, in
ishold
    return gca().ishold()
  File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 496, in
gca
    ax = gcf().gca(**kwargs)
  File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 218, in
gcf
    return figure()
  File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 208, in
figure
    draw_if_interactive()
  File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py",
line 1179, in draw_if_interactive
    figManager.canvas.draw()
  File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py",
line 901, in draw
    self.figure.draw(self.renderer)
  File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 797, in
draw
    if self.frameon: self.figurePatch.draw(renderer)
  File "C:\Python25\Lib\site-packages\matplotlib\patches.py", line 239, in
draw
    gc = renderer.new_gc()
  File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py",
line 361, in new_gc
    self.gc.select()
  File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py",
line 475, in select
    self.SelectObject(self.bitmap)
AttributeError: GraphicsContextWx instance has no attribute 'SelectObject'

Any ideas on how to make this work ?
Thanks in advance
Eli

···

--
View this message in context: http://www.nabble.com/Problem-plotting-interactively-from-PyCrust-tp18664574p18664574.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Does it work if you "use" 'WxAgg' instead? wxagg is the
recommended/supported wx plotting backend.

JDH

···

On Sat, Jul 26, 2008 at 3:33 AM, eliben <eliben@...287...> wrote:

Hello,

I'm running the latest matplotlib (and wxPython) with Python 2.5.2 on Win
XP. Everything works fine, the plotting quality is excellent, and
interactive plotting works nicely with IPython.

However, I much prefer the PyCrust interactive terminal and use it a lot. I
tried following the directions
(http://matplotlib.sourceforge.net/interactive.html) for interactive
plotting from PyCrust:

>>> import matplotlib
>>> matplotlib.interactive(True)
>>> matplotlib.use('WX')
>>> from matplotlib.pylab import *
>>> plot([1,2,3])

John Hunter-4 wrote:

Hello,

I'm running the latest matplotlib (and wxPython) with Python 2.5.2 on Win
XP. Everything works fine, the plotting quality is excellent, and
interactive plotting works nicely with IPython.

However, I much prefer the PyCrust interactive terminal and use it a lot.
I
tried following the directions
(http://matplotlib.sourceforge.net/interactive.html) for interactive
plotting from PyCrust:

>>> import matplotlib
>>> matplotlib.interactive(True)
>>> matplotlib.use('WX')
>>> from matplotlib.pylab import *
>>> plot([1,2,3])

Does it work if you "use" 'WxAgg' instead? wxagg is the
recommended/supported wx plotting backend.

JDH

Hello,

Yes, WXAgg works.
What is the difference between WXAgg and WX backends ? I couldn't find any
real documentation on the subject and I would really like to know. Can WX do
something WXAgg can't ?

Thanks
Eli

···

On Sat, Jul 26, 2008 at 3:33 AM, eliben <eliben@...287...> wrote:

--
View this message in context: http://www.nabble.com/Problem-plotting-interactively-from-PyCrust-tp18664574p18669376.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

WXAgg is the full featured wx backend, wx has limited support for all
of matplotlib's features. Agg is the antigrain C++ rendering library
(http://antigrain.com) that is the standard matplotlib raster backend.
See http://matplotlib.sourceforge.net/doc/html/faq/installing_faq.html#id1
for details.

JDH

···

On Sat, Jul 26, 2008 at 12:55 PM, eliben <eliben@...287...> wrote:

Yes, WXAgg works.
What is the difference between WXAgg and WX backends ? I couldn't find any
real documentation on the subject and I would really like to know. Can WX do
something WXAgg can't ?