Discussion:
matplotlib (embedding_in_wx5.py) runs perfectly on Windows, but is not compatible with Mac OS X
g***@gmail.com
2014-09-02 13:46:24 UTC
Permalink
matplotlib runs perfectly on Windows, but is not compatible with Mac OS X, cannot
be scaled operation, does not refresh guihave encountered this problem?

https://github.com/matplotlib/matplotlib/blob/master/examples/user_interfaces/embedding_in_wx5.py

Environment is: wxPython3.0 + matplotlib1.4 + Mac OS X10.8
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Werner
2014-09-02 16:12:38 UTC
Permalink
Hi,
Post by g***@gmail.com
matplotlib runs perfectly on Windows, but is not compatible with Mac
OS X, cannot be scaled operation, does not refresh guihave
encountered this problem?
https://github.com/matplotlib/matplotlib/blob/master/examples/user_interfaces/embedding_in_wx5.py
Environment is: wxPython3.0 + matplotlib1.4 + Mac OS X10.8
Do you see the problem just with that example? Is e.g.
embedding_in_wx2.py scaling for you?

You might want to report this also to the mpl list:
matplotlib-***@lists.sourceforge.net

Werner
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
g***@gmail.com
2014-09-03 08:01:10 UTC
Permalink
Not embedding_in_wx2.py, I test example is embedding_in_wx5.py.

圚 2014幎9月3日星期䞉UTC+8䞊午12时12分29秒werner写道
Post by g***@gmail.com
Hi,
matplotlib runs perfectly on Windows, but is not compatible with Mac OS X, cannot
be scaled operation, does not refresh guihave encountered this problem?
https://github.com/matplotlib/matplotlib/blob/master/examples/user_interfaces/embedding_in_wx5.py
Environment is: wxPython3.0 + matplotlib1.4 + Mac OS X10.8
Do you see the problem just with that example? Is e.g.
embedding_in_wx2.py scaling for you?
Werner
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
g***@gmail.com
2014-09-03 07:59:03 UTC
Permalink
I found that the scaling figure does not refresh。
Post by g***@gmail.com
matplotlib runs perfectly on Windows, but is not compatible with Mac OS X, cannot
be scaled operation, does not refresh guihave encountered this problem?
https://github.com/matplotlib/matplotlib/blob/master/examples/user_interfaces/embedding_in_wx5.py
Environment is: wxPython3.0 + matplotlib1.4 + Mac OS X10.8
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
g***@gmail.com
2014-09-03 12:32:26 UTC
Permalink
It is this effect, scaling, when the form is not refreshed。

<Loading Image...>
Post by g***@gmail.com
matplotlib runs perfectly on Windows, but is not compatible with Mac OS X, cannot
be scaled operation, does not refresh guihave encountered this problem?
https://github.com/matplotlib/matplotlib/blob/master/examples/user_interfaces/embedding_in_wx5.py
Environment is: wxPython3.0 + matplotlib1.4 + Mac OS X10.8
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Robin Dunn
2014-09-24 01:04:51 UTC
Permalink
Post by g***@gmail.com
It is this effect, scaling, when the form is not refreshed。
<https://lh3.googleusercontent.com/-bh828hLjH9o/VAcKJDCvgsI/AAAAAAAAAAM/S884M034oeo/s1600/QQ20140903-1.png>
It's been a couple years since I used MPL much, but IIRC this is a
problem in the MPL code in how they are using wx.ClientDC. They are
doing something like drawing with a wx.ClientDC while moving or sizing
objects instead of triggering a normal paint event. This is a bad idea
on any platform, but because of the design of the native UI code on OSX
it just can't work reliably there. In most cases a wx.ClientDC should
only be used for things like measuring text or such, and drawing to the
screen should be done in a paint event, triggered by a Refresh if
needed, and perhaps forced to be immediate with a call to Update().

I don't remember details, and unfortunately I don't have access to that
code anymore, but I think I was able to work around this issue in my
project by overriding some things in a class derived from MPL's canvas.
--
Robin Dunn
Software Craftsman
http://wxPython.org
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Chris Barker
2014-09-24 16:28:55 UTC
Permalink
It's been a couple years since I used MPL much, but IIRC this is a problem
in the MPL code in how they are using wx.ClientDC. They are doing
something like drawing with a wx.ClientDC while moving or sizing objects
instead of triggering a normal paint event.
Last I looked, the MPL wx code was a pretty ugly mess of clientDC, Blit(),
Refresh(), etc -- It started one way, then fixes were hacked on for
particular issues. It could really use some love, and a refactor to PaintDC
is probably what it needs.

If I need this to work for something, I may get in there and try to clean
it up -- but don't hold your breath, I've got too may other things on my
plate as it is. Sorry :-(

But if someone wants to dig in, I'll try to help if you have specific
questions.

-Chris
--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

***@noaa.gov
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Werner
2014-09-25 08:08:23 UTC
Permalink
Hi Chris and OP,
Post by Robin Dunn
It's been a couple years since I used MPL much, but IIRC this is a
problem in the MPL code in how they are using wx.ClientDC. They
are doing something like drawing with a wx.ClientDC while moving
or sizing objects instead of triggering a normal paint event.
Last I looked, the MPL wx code was a pretty ugly mess of clientDC,
Blit(), Refresh(), etc -- It started one way, then fixes were hacked
on for particular issues. It could really use some love, and a
refactor to PaintDC is probably what it needs.
If I need this to work for something, I may get in there and try to
clean it up -- but don't hold your breath, I've got too may other
things on my plate as it is. Sorry :-(
But if someone wants to dig in, I'll try to help if you have specific
questions.
I started some time ago some work on mpl (1.4) wx backends, main focus
was to get it to work with Phoenix and to run on Python 3, see this PR:
https://github.com/matplotlib/matplotlib/pull/3421

Outstanding issues is that the 'wx' backend does not show graphic as of
2.9 (this seems to be an old issue) on Windows but it works on Mac
(tested by jenshnielsen) in e.g. the embedding_in_wx2.py example and the
issue mentioned in this thread.

The current code uses wx.PaintDC in the OnPaint handler, it uses
wx.MemoryDC especially in the 'wxagg' backend together with
wx.GraphicsContext and then there is wx.ClientDC in gui_repaint method
if it is called without a wx.PaintDC.

I wouldn't mind trying but would definitely need help and some tips on
how to get going.

Werner
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Werner
2014-09-25 13:38:30 UTC
Permalink
Post by g***@gmail.com
It is this effect, scaling, when the form is not refreshed。
<https://lh3.googleusercontent.com/-bh828hLjH9o/VAcKJDCvgsI/AAAAAAAAAAM/S884M034oeo/s1600/QQ20140903-1.png>
matplotlib runs perfectly on Windows, but is not compatible with
Mac OS X, cannot be scaled operation, does not refresh guihave
encountered this problem?
https://github.com/matplotlib/matplotlib/blob/master/examples/user_interfaces/embedding_in_wx5.py
<https://github.com/matplotlib/matplotlib/blob/master/examples/user_interfaces/embedding_in_wx5.py>
Environment is: wxPython3.0 + matplotlib1.4 + Mac OS X10.8
Could you please try and change the backend_wx.py.

In the method 'FigureCanvasWx.gui_repaint' replace this:

drawDC.DrawBitmap(self.bitmap, 0, 0)

with this:
drawDC.Clear()
drawDC.DrawBitmap(self.bitmap, 0, 0)


Werner
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...