backend_wx and 0.98.0

My app uses the wx backend, so I happened to notice
that the backend_wx doesn't seem to work with
matplotlib 0.98.0. Running the 0.98 example embedding_in_wx.py
shows the problem. Only a bit of the lines get plotted. The
pan up/down zoom in/out all show various error messages.
When i revert back to 0.91.3 and run the same 0.91 example
it works fine.

  Not a big deal for me (perhaps the only person still using
the wx backend), i'm in the process of switching my app to qt4
and the embedding_in_qt4.py example works fine in 0.98.

Jim

Hey James, we were discussing problems with the wx backend on 0.98
yesterday on the devel list, and Ken offered to take a look at them,
so it is possible we will have those fixed for the next bugfix
release. What wx version are you using?

Note that unless you are running over an x11 connection, there is
little reason to prefer wx over wxagg, which has better rendering and
more features. Over an x11 connection, wxagg is slow because it has
to pass the who bitmap over the wire, but otherwise it works great.

JDH

···

On Thu, Jun 12, 2008 at 9:21 PM, James A. Benson <jbenson@...109...> wrote:

  My app uses the wx backend, so I happened to notice
that the backend_wx doesn't seem to work with
matplotlib 0.98.0. Running the 0.98 example embedding_in_wx.py
shows the problem. Only a bit of the lines get plotted. The
pan up/down zoom in/out all show various error messages.
When i revert back to 0.91.3 and run the same 0.91 example
it works fine.

Sorry I'm just getting into this discussion now.

The wx backend in 0.98 is almost a complete rewrite to use wx.GraphicsContext rather than the older wx.DC interface. It was no longer possible to move forward with the new rendering infrastructure with the wx.DC interface due to lack of support for polycurves. As the wx backend is one of the least used, perhaps, it hasn't seen the same amount of testing as the others and you're running into the bleeding edge. (And some of us still insert an implicit "beta" everytime we see the number 0.98... :wink:

Note that in my testing, the new wx backend isn't any faster than wxagg over an X11 connection, and locally it's *insanely* slow. On Linux it uses Cairo, which has the same bitmap transferring issues that Agg has. So that eliminates any advantages it may have had. Possibly if one were doing some wx.GraphicsContext rendering interleaved with matplotlib rendering it might be useful, but I doubt there's any of that in the wild. I would strongly suggest we just remove the wx backend at this point and move to wxAgg for everything. I advocated this months ago, but forgot to follow through on it --->

http://sourceforge.net/mailarchive/message.php?msg_id=4734927C.3060601%40stsci.edu

Local:
WxAgg: 27.5 fps
Wx: 1.8 fps
Wx: 16.8 fps (without clipping)

Network (X11 with compression):
WxAgg: 2.0 fps
Wx: 1.7 fps
Wx: 2.0 fps (without clipping)

Cheers,
Mike

John Hunter wrote:

···

On Thu, Jun 12, 2008 at 9:21 PM, James A. Benson > <jbenson@...109...> wrote:
  

  My app uses the wx backend, so I happened to notice
that the backend_wx doesn't seem to work with
matplotlib 0.98.0. Running the 0.98 example embedding_in_wx.py
shows the problem. Only a bit of the lines get plotted. The
pan up/down zoom in/out all show various error messages.
When i revert back to 0.91.3 and run the same 0.91 example
it works fine.
    
Hey James, we were discussing problems with the wx backend on 0.98
yesterday on the devel list, and Ken offered to take a look at them,
so it is possible we will have those fixed for the next bugfix
release. What wx version are you using?

Note that unless you are running over an x11 connection, there is
little reason to prefer wx over wxagg, which has better rendering and
more features. Over an x11 connection, wxagg is slow because it has
to pass the who bitmap over the wire, but otherwise it works great.

JDH

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

For what it's worth, the WX backend isn't working for me with wxPython
2.8.4; I get the following when I attempt to show a figure:

  File "C:\Program
Files\Python25\lib\site-packages\matplotlib-0.98.0_r5467-py2.5-win32.egg\mat
plotlib\backends\backend_wx.py", line 474, in select
    self.SelectObject(self.bitmap)
AttributeError: GraphicsContextWx instance has no attribute 'SelectObject'

I'm at wxPython 2.8.4 simply because it is included with the Enthought
Python Distribution that I picked for getting started with Python.

However, I don't normally use the WX backend. I've been using WXAgg, so WX
is relevant for me only for the functionality inherited by WXAgg.

Stan

Hi Stan,

For what it's worth, the WX backend isn't working for me with wxPython
2.8.4; I get the following when I attempt to show a figure:

File "C:\Program
Files\Python25\lib\site-packages\matplotlib-0.98.0_r5467-py2.5-win32.egg\mat
plotlib\backends\backend_wx.py", line 474, in select
   self.SelectObject(self.bitmap)
AttributeError: GraphicsContextWx instance has no attribute 'SelectObject'

I'm at wxPython 2.8.4 simply because it is included with the Enthought
Python Distribution that I picked for getting started with Python.

However, I don't normally use the WX backend. I've been using WXAgg, so WX
is relevant for me only for the functionality inherited by WXAgg.

Please upgrade wxPython to the latest release (2.8.7.1) from here:

http://www.wxpython.org/download.php#binaries

Or use the very latest pre-release:

http://wxpython.wxcommunity.com/preview/20080608

This will (probably) fix the problem you see with wx.GraphicsContext,
although I know next to nothing about matplotlib internal handling of
wxPython things.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Fri, Jun 13, 2008 at 2:09 PM, Stan West wrote:

FWIW, I developed the new wx backend using wx 2.8.6.1, and it does currently work for me. Unfortunately, it's always hard to know how to write for a broad range of point releases for wxPython -- the documentation offers little clues about when features were added or changed.

Cheers,
Mike

Andrea Gavana wrote:

···

Hi Stan,

On Fri, Jun 13, 2008 at 2:09 PM, Stan West wrote:
  

For what it's worth, the WX backend isn't working for me with wxPython
2.8.4; I get the following when I attempt to show a figure:

File "C:\Program
Files\Python25\lib\site-packages\matplotlib-0.98.0_r5467-py2.5-win32.egg\mat
plotlib\backends\backend_wx.py", line 474, in select
   self.SelectObject(self.bitmap)
AttributeError: GraphicsContextWx instance has no attribute 'SelectObject'

I'm at wxPython 2.8.4 simply because it is included with the Enthought
Python Distribution that I picked for getting started with Python.

However, I don't normally use the WX backend. I've been using WXAgg, so WX
is relevant for me only for the functionality inherited by WXAgg.
    
Please upgrade wxPython to the latest release (2.8.7.1) from here:

Redirecting...

Or use the very latest pre-release:

http://wxpython.wxcommunity.com/preview/20080608

This will (probably) fix the problem you see with wx.GraphicsContext,
although I know next to nothing about matplotlib internal handling of
wxPython things.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Hi Michael,

···

On Fri, Jun 13, 2008 at 2:23 PM, Michael Droettboom wrote:

FWIW, I developed the new wx backend using wx 2.8.6.1, and it does currently
work for me. Unfortunately, it's always hard to know how to write for a
broad range of point releases for wxPython -- the documentation offers
little clues about when features were added or changed.

Then it might be possible that something has changed between 2.8.4.0
(the OP wxPython version) and 2.8.6.0 (yours), although it looks like
a wxWidgets difference rather than a wxPython one...

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

Hi, Andrea. Yes, I bet that upgrading would resolve the issue. However,
the issue isn't getting in my way at the moment, since I use the WXAgg
backend and it works well as far as I can tell. I mainly wanted to point
out for informational purposes -- and I may have been unclear about my point
-- that the Enthought Python distribution is currently at wxPython 2.8.4 and
that the WX backend seems not to work at that version.

  My app uses the wx backend, so I happened to notice
that the backend_wx doesn't seem to work with
matplotlib 0.98.0. Running the 0.98 example embedding_in_wx.py
shows the problem. Only a bit of the lines get plotted. The
pan up/down zoom in/out all show various error messages.
When i revert back to 0.91.3 and run the same 0.91 example
it works fine.

Hey James, we were discussing problems with the wx backend on 0.98
yesterday on the devel list, and Ken offered to take a look at them,
so it is possible we will have those fixed for the next bugfix
release. What wx version are you using?

Sorry, I forgot to include that important detail. I
see the problem on a Linux F8 machine with wx version 2.8.7.1

Note that unless you are running over an x11 connection, there is
little reason to prefer wx over wxagg, which has better rendering and
more features. Over an x11 connection, wxagg is slow because it has
to pass the who bitmap over the wire, but otherwise it works great.

JDH

Thanks for the advice and later comments on this thread from
Michael. Sounds like i'm definitely doing the right
thing by switching from the wx backend to perhaps any other backend.
I'm going with the qt4 backend.

Thanks,

Jim

···

On Fri, 13 Jun 2008, John Hunter wrote:

On Thu, Jun 12, 2008 at 9:21 PM, James A. Benson > wrote: