SourceForge logo
SourceForge logo
Menu

matplotlib-devel — matplotlib developers

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
(1)
Nov
(33)
Dec
(20)
2004 Jan
(7)
Feb
(44)
Mar
(51)
Apr
(43)
May
(43)
Jun
(36)
Jul
(61)
Aug
(44)
Sep
(25)
Oct
(82)
Nov
(97)
Dec
(47)
2005 Jan
(77)
Feb
(143)
Mar
(42)
Apr
(31)
May
(93)
Jun
(93)
Jul
(35)
Aug
(78)
Sep
(56)
Oct
(44)
Nov
(72)
Dec
(75)
2006 Jan
(116)
Feb
(99)
Mar
(181)
Apr
(171)
May
(112)
Jun
(86)
Jul
(91)
Aug
(111)
Sep
(77)
Oct
(72)
Nov
(57)
Dec
(51)
2007 Jan
(64)
Feb
(116)
Mar
(70)
Apr
(74)
May
(53)
Jun
(40)
Jul
(519)
Aug
(151)
Sep
(132)
Oct
(74)
Nov
(282)
Dec
(190)
2008 Jan
(141)
Feb
(67)
Mar
(69)
Apr
(96)
May
(227)
Jun
(404)
Jul
(399)
Aug
(96)
Sep
(120)
Oct
(205)
Nov
(126)
Dec
(261)
2009 Jan
(136)
Feb
(136)
Mar
(119)
Apr
(124)
May
(155)
Jun
(98)
Jul
(136)
Aug
(292)
Sep
(174)
Oct
(126)
Nov
(126)
Dec
(79)
2010 Jan
(109)
Feb
(83)
Mar
(139)
Apr
(91)
May
(79)
Jun
(164)
Jul
(184)
Aug
(146)
Sep
(163)
Oct
(128)
Nov
(70)
Dec
(73)
2011 Jan
(235)
Feb
(165)
Mar
(147)
Apr
(86)
May
(74)
Jun
(118)
Jul
(65)
Aug
(75)
Sep
(162)
Oct
(94)
Nov
(48)
Dec
(44)
2012 Jan
(49)
Feb
(40)
Mar
(88)
Apr
(35)
May
(52)
Jun
(69)
Jul
(90)
Aug
(123)
Sep
(112)
Oct
(120)
Nov
(105)
Dec
(116)
2013 Jan
(76)
Feb
(26)
Mar
(78)
Apr
(43)
May
(61)
Jun
(53)
Jul
(147)
Aug
(85)
Sep
(83)
Oct
(122)
Nov
(18)
Dec
(27)
2014 Jan
(58)
Feb
(25)
Mar
(49)
Apr
(17)
May
(29)
Jun
(39)
Jul
(53)
Aug
(52)
Sep
(35)
Oct
(47)
Nov
(110)
Dec
(27)
2015 Jan
(50)
Feb
(93)
Mar
(96)
Apr
(30)
May
(55)
Jun
(83)
Jul
(44)
Aug
(8)
Sep
(5)
Oct
Nov
(1)
Dec
(1)
2016 Jan
Feb
Mar
(1)
Apr
May
Jun
(2)
Jul
Aug
(3)
Sep
(1)
Oct
(3)
Nov
Dec
2017 Jan
Feb
(5)
Mar
Apr
May
Jun
Jul
(3)
Aug
Sep
(7)
Oct
Nov
Dec
2018 Jan
Feb
Mar
Apr
May
Jun
Jul
(2)
Aug
Sep
Oct
Nov
Dec
S M T W T F S






1
2
3
(1)
4
(2)
5
6
7
(1)
8
(2)
9
10
(1)
11
(3)
12
(7)
13
(5)
14
(3)
15
(1)
16
(1)
17
(4)
18
19
(2)
20
21
(10)
22
(2)
23
(2)
24
25
(1)
26
27
28
(15)
29
(5)
30
(8)
31
(3)





Showing 3 results of 3

From: Dennis M. <djm...@gm...> - 2010年05月14日 22:17:25
We have an app that creates some background threads and is doing work at 
the same time it displays a pylab figure. We noticed the worker threads 
stopped working while we're looking at the figure and then things start 
working again after we close it.
Turns out, from the faq [1], you can have background threads with GtkAgg 
if you call gobject.threads_init().
I changed my matplotlib/backends/backend_gtk.py to:
try:
 import gobject
 import gtk; gdk = gtk.gdk
 import pango
 gobject.threads_init()
except ImportError:
 raise ImportError("Gtk* backend requires pygtk to be installed.")
Sure enough, I can now have my worker threads continue in the background 
while we're watching the figure. I'm not sure if this should be the 
default behavior or if there ought to be a way to customize the backend 
for individual usage.
A side note however: We run the same app with a wxPython frontend 
sometimes. In this mode, the backend is WxAgg. The Wx backend does not 
have the same default behavior as the GTK backend. Our worker threads 
continue to do work properly with this backend. I tried PyQt with a 
small test app as well. It appears only GTK blocked everything so I 
think perhaps this change should be applied.
-Dennis
[1] http://bit.ly/buQROp
From: Darren D. <dsd...@gm...> - 2010年05月14日 19:08:11
On Fri, May 14, 2010 at 2:39 PM, Tony S Yu <to...@mi...> wrote:
> I'm running the Qt4 backend, and I noticed that I'd frequently get error messages saying I was pressing unrecognized keys. It turns out that the direction keys aren't recognized in the qt4 backend. (I'm using direction keys to switch between spaces in OSX, so this error gets triggered quite frequently)
>
> One possible fix is to just add the direction keys to the list of valid keys (see patch below). Alternatively, the key event code could just ignore unrecognized keys (i.e. `key == None`). This change could be made in FigureCanvasQT.keyPressEvent (in backends.backend_qt4.py) or, more generally, in FigureCanvasBase.key_press_event (in backend_bases.py).
>
> -Tony
>
> %---Diff
>
> Index: lib/matplotlib/backends/backend_qt4.py
> ===================================================================
> --- lib/matplotlib/backends/backend_qt4.py   (revision 8315)
> +++ lib/matplotlib/backends/backend_qt4.py   (working copy)
> @@ -129,6 +129,10 @@
>   keyvald = { QtCore.Qt.Key_Control : 'control',
>         QtCore.Qt.Key_Shift : 'shift',
>         QtCore.Qt.Key_Alt : 'alt',
> +        QtCore.Qt.Key_Up : 'up',
> +        QtCore.Qt.Key_Right : 'right',
> +        QtCore.Qt.Key_Down : 'down',
> +        QtCore.Qt.Key_Left : 'left',
>        }
>   # left 1, middle 2, right 3
>   buttond = {1:1, 2:3, 4:2}
>
>
> %---Full traceback
>
> Traceback (most recent call last):
> File "/Users/Tony/python/devel/mpl/lib/matplotlib/backends/backend_qt4.py", line 198, in keyPressEvent
>  FigureCanvasBase.key_press_event( self, key )
> File "/Users/Tony/python/devel/mpl/lib/matplotlib/backend_bases.py", line 1459, in key_press_event
>  self.callbacks.process(s, event)
> File "/Users/Tony/python/devel/mpl/lib/matplotlib/cbook.py", line 169, in process
>  func(*args, **kwargs)
> File "/Users/Tony/python/devel/mpl/lib/matplotlib/backend_bases.py", line 2079, in key_press
>  if event.key in fullscreen_keys:
> TypeError: 'in <string>' requires string as left operand, not NoneType
I can commit the change to backend_qt4, but I need to run the change
to backendbases by the other devs. Is there any reason not to do the
following?:
===================================================================
--- lib/matplotlib/backend_bases.py	(revision 8306)
+++ lib/matplotlib/backend_bases.py	(working copy)
@@ -1,4 +1,3 @@
-
 """
 Abstract base classes define the primitives that renderers and
 graphics contexts must implement to serve as a matplotlib backend
@@ -1450,9 +1449,11 @@
 def key_press_event(self, key, guiEvent=None):
 """
- This method will be call all functions connected to the
+ This method will call all functions connected to the
 'key_press_event' with a :class:`KeyEvent`
 """
+ if key is None:
+ return
 self._key = key
 s = 'key_press_event'
 event = KeyEvent(s, self, key, self._lastx, self._lasty,
guiEvent=guiEvent)
From: Tony S Yu <to...@MI...> - 2010年05月14日 18:39:46
I'm running the Qt4 backend, and I noticed that I'd frequently get error messages saying I was pressing unrecognized keys. It turns out that the direction keys aren't recognized in the qt4 backend. (I'm using direction keys to switch between spaces in OSX, so this error gets triggered quite frequently)
One possible fix is to just add the direction keys to the list of valid keys (see patch below). Alternatively, the key event code could just ignore unrecognized keys (i.e. `key == None`). This change could be made in FigureCanvasQT.keyPressEvent (in backends.backend_qt4.py) or, more generally, in FigureCanvasBase.key_press_event (in backend_bases.py).
-Tony
%---Diff
Index: lib/matplotlib/backends/backend_qt4.py
===================================================================
--- lib/matplotlib/backends/backend_qt4.py	(revision 8315)
+++ lib/matplotlib/backends/backend_qt4.py	(working copy)
@@ -129,6 +129,10 @@
 keyvald = { QtCore.Qt.Key_Control : 'control',
 QtCore.Qt.Key_Shift : 'shift',
 QtCore.Qt.Key_Alt : 'alt',
+ QtCore.Qt.Key_Up : 'up',
+ QtCore.Qt.Key_Right : 'right',
+ QtCore.Qt.Key_Down : 'down',
+ QtCore.Qt.Key_Left : 'left',
 }
 # left 1, middle 2, right 3
 buttond = {1:1, 2:3, 4:2}
%---Full traceback
Traceback (most recent call last):
 File "/Users/Tony/python/devel/mpl/lib/matplotlib/backends/backend_qt4.py", line 198, in keyPressEvent
 FigureCanvasBase.key_press_event( self, key )
 File "/Users/Tony/python/devel/mpl/lib/matplotlib/backend_bases.py", line 1459, in key_press_event
 self.callbacks.process(s, event)
 File "/Users/Tony/python/devel/mpl/lib/matplotlib/cbook.py", line 169, in process
 func(*args, **kwargs)
 File "/Users/Tony/python/devel/mpl/lib/matplotlib/backend_bases.py", line 2079, in key_press
 if event.key in fullscreen_keys:
TypeError: 'in <string>' requires string as left operand, not NoneType

Showing 3 results of 3

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /