SourceForge logo
SourceForge logo
Menu

matplotlib-checkins

Revision: 5874
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5874&view=rev
Author: jdh2358
Date: 2008年07月25日 15:09:08 +0000 (2008年7月25日)
Log Message:
-----------
fixed start event loop docstring
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2008年07月25日 13:17:10 UTC (rev 5873)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2008年07月25日 15:09:08 UTC (rev 5874)
@@ -1069,7 +1069,7 @@
 else:
 self._button = 'down'
 s = 'scroll_event'
- mouseevent = MouseEvent(s, self, x, y, self._button, self._key, 
+ mouseevent = MouseEvent(s, self, x, y, self._button, self._key,
 step=step, guiEvent=guiEvent)
 self.callbacks.process(s, mouseevent)
 
@@ -1437,7 +1437,7 @@
 
 Call signature::
 
- start_event_loop_default(self,timeout=0)
+ start_event_loop_default(self,timeout=0)
 
 This call blocks until a callback function triggers
 stop_event_loop() or *timeout* is reached. If *timeout* is
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5904
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5904&view=rev
Author: ryanmay
Date: 2008年07月27日 20:33:45 +0000 (2008年7月27日)
Log Message:
-----------
Fix a couple of docstring typos.
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2008年07月27日 17:18:30 UTC (rev 5903)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2008年07月27日 20:33:45 UTC (rev 5904)
@@ -472,7 +472,7 @@
 def get_clip_path(self):
 """
 Return the clip path in the form (path, transform), where path
- is a :class:`~matplotlib.path.Path` instance, and transform as
+ is a :class:`~matplotlib.path.Path` instance, and transform is
 an affine transform to apply to the path before clipping.
 """
 if self._clippath is not None:
@@ -653,7 +653,7 @@
 
 class IdleEvent(Event):
 """
- An event triggered by the GUI backend when it is idel -- useful
+ An event triggered by the GUI backend when it is idle -- useful
 for passive animation
 """
 pass
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6447
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6447&view=rev
Author: jdh2358
Date: 2008年11月25日 18:28:13 +0000 (2008年11月25日)
Log Message:
-----------
fixed a zoom bug in sharex axis
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2008年11月25日 15:23:28 UTC (rev 6446)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2008年11月25日 18:28:13 UTC (rev 6447)
@@ -269,7 +269,7 @@
 gc.set_alpha(rgbFace[-1])
 rgbFace = rgbFace[:3]
 gc.set_antialiased(antialiaseds[i % Naa])
- 
+
 if Nurls:
 gc.set_url(urls[i % Nurls])
 
@@ -527,7 +527,7 @@
 matlab format string, a html hex color string, or a rgb tuple
 """
 return self._rgb
- 
+
 def get_url(self):
 """
 returns a url if one is set, None otherwise
@@ -633,7 +633,7 @@
 raise ValueError('Unrecognized linestyle: %s' % style)
 self._linestyle = style
 self.set_dashes(offset, dashes)
- 
+
 def set_url(self, url):
 """
 Sets the url for links in compatible backends
@@ -1531,7 +1531,7 @@
 
 if event.key == 'f':
 self.full_screen_toggle()
- 
+
 # *h*ome or *r*eset mnemonic
 elif event.key == 'h' or event.key == 'r' or event.key == "home":
 self.canvas.toolbar.home()
@@ -1883,8 +1883,14 @@
 for cur_xypress in self._xypress:
 x, y = event.x, event.y
 lastx, lasty, a, ind, lim, trans = cur_xypress
+ # JDH: I don't know why this is here but I expect to be
+ # able to zoomo on any axis that is shared. This was
+ # breaking zoom-to-rect on sharex_axis_demo if the zoom
+ # happened in ax2 or ax3 so i am replacing the continue
+ # with a pass until this is sorted out
 if a._sharex or a._sharey:
- continue
+ #continue
+ pass
 # ignore singular clicks - 5 pixels is a threshold
 if abs(x-lastx)<5 or abs(y-lasty)<5:
 self._xypress = None
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6449
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6449&view=rev
Author: mdboom
Date: 2008年11月25日 19:33:05 +0000 (2008年11月25日)
Log Message:
-----------
Remove code that was inadvertently merged from branch.
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2008年11月25日 18:56:57 UTC (rev 6448)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2008年11月25日 19:33:05 UTC (rev 6449)
@@ -1883,14 +1883,7 @@
 for cur_xypress in self._xypress:
 x, y = event.x, event.y
 lastx, lasty, a, ind, lim, trans = cur_xypress
- # JDH: I don't know why this is here but I expect to be
- # able to zoomo on any axis that is shared. This was
- # breaking zoom-to-rect on sharex_axis_demo if the zoom
- # happened in ax2 or ax3 so i am replacing the continue
- # with a pass until this is sorted out
- if a._sharex or a._sharey:
- #continue
- pass
+
 # ignore singular clicks - 5 pixels is a threshold
 if abs(x-lastx)<5 or abs(y-lasty)<5:
 self._xypress = None
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6569
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6569&view=rev
Author: mdboom
Date: 2008年12月11日 20:44:40 +0000 (2008年12月11日)
Log Message:
-----------
Added a member for snapping
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2008年12月11日 20:44:32 UTC (rev 6568)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2008年12月11日 20:44:40 UTC (rev 6569)
@@ -436,6 +436,7 @@
 self._rgb = (0.0, 0.0, 0.0)
 self._hatch = None
 self._url = None
+ self._snap = None
 
 def copy_properties(self, gc):
 'Copy properties from gc to self'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7221
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7221&view=rev
Author: jdh2358
Date: 2009年06月14日 17:38:12 +0000 (2009年6月14日)
Log Message:
-----------
fixed a press/release pan bug when mouse button=2 as described in sf bug 2805312
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2009年06月14日 17:34:40 UTC (rev 7220)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2009年06月14日 17:38:12 UTC (rev 7221)
@@ -2007,6 +2007,9 @@
 
 def release_pan(self, event):
 'the release mouse button callback in pan/zoom mode'
+
+ if self._button_pressed is None:
+ return
 self.canvas.mpl_disconnect(self._idDrag)
 self._idDrag=self.canvas.mpl_connect('motion_notify_event', self.mouse_move)
 for a, ind in self._xypress:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7855
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7855&view=rev
Author: astraw
Date: 2009年10月06日 15:53:34 +0000 (2009年10月06日)
Log Message:
-----------
trivial: delete trailing whitespace from source code lines
(This is really an excuse to make an SVN commit to trigger the buildbot.)
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2009年10月06日 15:47:13 UTC (rev 7854)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2009年10月06日 15:53:34 UTC (rev 7855)
@@ -390,18 +390,18 @@
 
 *s*
 text to be converted
- 
+
 *usetex*
 If True, use matplotlib usetex mode.
 
 *ismath*
 If True, use mathtext parser. If "TeX", use *usetex* mode.
 """
- 
+
 text2path = self._text2path
 color = gc.get_rgb()[:3]
 fontsize = self.points_to_pixels(prop.get_size_in_points())
- 
+
 if ismath == "TeX":
 verts, codes = text2path.get_text_path(prop, s, ismath=False, usetex=True)
 else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7946
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7946&view=rev
Author: leejjoon
Date: 2009年11月06日 21:54:57 +0000 (2009年11月06日)
Log Message:
-----------
do not check the visibility of bbox_extra_artists of savefig
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2009年11月06日 19:26:35 UTC (rev 7945)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2009年11月06日 21:54:57 UTC (rev 7946)
@@ -1613,8 +1613,8 @@
 renderer = self.figure._cachedRenderer
 bbox_inches = self.figure.get_tightbbox(renderer)
 
- bb = [a.get_window_extent(renderer) for a in kwargs.pop("bbox_extra_artists", []) \
- if a.get_visible()]
+ bb = [a.get_window_extent(renderer) for a \
+ in kwargs.pop("bbox_extra_artists", [])]
 if bb:
 _bbox = Bbox.union([b for b in bb if b.width!=0 or b.height!=0])
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7959
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7959&view=rev
Author: astraw
Date: 2009年11月12日 22:49:37 +0000 (2009年11月12日)
Log Message:
-----------
fix typo
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2009年11月12日 22:47:43 UTC (rev 7958)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2009年11月12日 22:49:37 UTC (rev 7959)
@@ -335,7 +335,7 @@
 
 def option_image_nocomposite(self):
 """
- overwrite this method for renderers that do not necessarily
+ override this method for renderers that do not necessarily
 want to rescale and composite raster images. (like SVG)
 """
 return False
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8230
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8230&view=rev
Author: efiring
Date: 2010年04月15日 07:06:10 +0000 (2010年4月15日)
Log Message:
-----------
backend_bases: handle facecolor [0,0,0,0] in patch collection; fixes 2881485
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年04月14日 22:44:13 UTC (rev 8229)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年04月15日 07:06:10 UTC (rev 8230)
@@ -298,6 +298,8 @@
 xo, yo = toffsets[i % Noffsets]
 if Nfacecolors:
 rgbFace = facecolors[i % Nfacecolors]
+ if len(rgbFace) == 4 and rgbFace[3] == 0:
+ rgbFace = None
 if Nedgecolors:
 gc0.set_foreground(edgecolors[i % Nedgecolors])
 if Nlinewidths:
@@ -1534,14 +1536,14 @@
 # check for registered backends
 if format in _backend_d:
 backend_class = _backend_d[format]
- 
+
 def _print_method(*args, **kwargs):
 backend = self.switch_backends(backend_class)
 print_method = getattr(backend, method_name)
 return print_method(*args, **kwargs)
 
 return _print_method
- 
+
 if (format not in self.filetypes or
 not hasattr(self, method_name)):
 formats = self.filetypes.keys()
@@ -1610,7 +1612,7 @@
 format = format.lower()
 
 print_method = self._get_print_method(format)
- 
+
 if dpi is None:
 dpi = rcParams['savefig.dpi']
 
@@ -2233,7 +2235,7 @@
 self._switch_off_zoom_mode)
 
 self._ids_zoom = id1, id2, id3
- 
+
 self._zoom_mode = event.key
 
 
@@ -2242,11 +2244,11 @@
 def _switch_on_zoom_mode(self, event):
 self._zoom_mode = event.key
 self.mouse_move(event)
- 
+
 def _switch_off_zoom_mode(self, event):
 self._zoom_mode = None
 self.mouse_move(event)
- 
+
 def push_current(self):
 'push the current view limits and position onto the stack'
 lims = []; pos = []
@@ -2298,11 +2300,11 @@
 x, y = event.x, event.y
 lastx, lasty, a, ind, lim, trans = self._xypress[0]
 
- # adjust x, last, y, last 
+ # adjust x, last, y, last
 x1, y1, x2, y2 = a.bbox.extents
 x, lastx = max(min(x, lastx), x1), min(max(x, lastx), x2)
 y, lasty = max(min(y, lasty), y1), min(max(y, lasty), y2)
- 
+
 if self._zoom_mode == "x":
 x1, y1, x2, y2 = a.bbox.extents
 y, lasty = y1, y2
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8231
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8231&view=rev
Author: efiring
Date: 2010年04月15日 07:17:42 +0000 (2010年4月15日)
Log Message:
-----------
Fixed a problem in the last commit
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年04月15日 07:06:10 UTC (rev 8230)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年04月15日 07:17:42 UTC (rev 8231)
@@ -298,8 +298,6 @@
 xo, yo = toffsets[i % Noffsets]
 if Nfacecolors:
 rgbFace = facecolors[i % Nfacecolors]
- if len(rgbFace) == 4 and rgbFace[3] == 0:
- rgbFace = None
 if Nedgecolors:
 gc0.set_foreground(edgecolors[i % Nedgecolors])
 if Nlinewidths:
@@ -307,8 +305,11 @@
 if Nlinestyles:
 gc0.set_dashes(*linestyles[i % Nlinestyles])
 if rgbFace is not None and len(rgbFace)==4:
- gc0.set_alpha(rgbFace[-1])
- rgbFace = rgbFace[:3]
+ if rgbFace[3] == 0:
+ rgbFace = None
+ else:
+ gc0.set_alpha(rgbFace[-1])
+ rgbFace = rgbFace[:3]
 gc0.set_antialiased(antialiaseds[i % Naa])
 if Nurls:
 gc0.set_url(urls[i % Nurls])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8236
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8236&view=rev
Author: ryanmay
Date: 2010年04月16日 18:37:44 +0000 (2010年4月16日)
Log Message:
-----------
Remove debug output.
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年04月16日 18:32:53 UTC (rev 8235)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年04月16日 18:37:44 UTC (rev 8236)
@@ -1,3 +1,4 @@
+
 """
 Abstract base classes define the primitives that renderers and
 graphics contexts must implement to serve as a matplotlib backend
@@ -928,7 +929,6 @@
 """
 def __init__(self, name, canvas, guiEvent=None):
 Event.__init__(self, name, canvas, guiEvent)
- print 'Initing CloseEvent'
 
 class LocationEvent(Event):
 """
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8250
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8250&view=rev
Author: ryanmay
Date: 2010年04月20日 19:40:12 +0000 (2010年4月20日)
Log Message:
-----------
Add base support and API for creating backend-independant timers, implemented using the GUI toolkit's timer support.
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年04月20日 19:01:53 UTC (rev 8249)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年04月20日 19:40:12 UTC (rev 8250)
@@ -861,6 +861,137 @@
 return None
 return Path.hatch(self._hatch, density)
 
+
+class TimerBase(object):
+ '''
+ A base class for providing timer events, useful for things animations.
+ Backends need to implement a few specific methods in order to use their
+ own timing mechanisms so that the timer events are integrated into their
+ event loops.
+ 
+ Mandatory functions that must be implemented:
+ * _timer_start: Contains backend-specific code for starting the timer
+ * _timer_stop: Contains backend-specific code for stopping the timer
+
+ Optional overrides:
+ * _timer_set_single_shot: Code for setting the timer to single shot
+ operating mode, if supported by the timer object. If not, the Timer
+ class itself will store the flag and the _on_timer method should
+ be overridden to support such behavior.
+ * _timer_set_interval: Code for setting the interval on the timer, if
+ there is a method for doing so on the timer object.
+ * _on_timer: This is the internal function that any timer object should
+ call, which will handle the task of running all callbacks that have
+ been set.
+ 
+ Attributes:
+ * interval: The time between timer events in milliseconds. Default
+ is 1000 ms.
+ * single_shot: Boolean flag indicating whether this timer should
+ operate as single shot (run once and then stop). Defaults to False.
+ * callbacks: Stores list of (func, args) tuples that will be called
+ upon timer events. This list can be manipulated directly, or the
+ functions add_callback and remove_callback can be used.
+ '''
+ def __init__(self):
+ #Initialize empty callbacks list and setup default settings
+ self.callbacks = []
+ self._single = False
+ self._interval = 1000
+
+ # Default attribute for holding the GUI-specific timer object
+ self._timer = None
+
+ def __del__(self):
+ 'Need to stop timer and possibly disconnect timer.'
+ self._timer_stop()
+
+ def start(self, interval=None):
+ '''
+ Start the timer object. `interval` is optional and will be used
+ to reset the timer interval first if provided.
+ '''
+ if interval is not None:
+ self.set_interval(interval)
+ self._timer_start()
+
+ def stop(self):
+ '''
+ Stop the timer.
+ '''
+ self._timer_stop()
+
+ def _timer_start(self):
+ #TODO: Could we potentially make a generic version through
+ #the use of Threads?
+ raise NotImplementedError('Needs to be implemented by subclass.')
+
+ def _timer_stop(self):
+ #TODO: Could we potentially make a generic version through
+ #the use of Threads?
+ raise NotImplementedError('Needs to be implemented by subclass.')
+
+ def _get_interval(self):
+ return self._interval
+
+ def _set_interval(self, interval):
+ self._interval = interval
+ self._timer_set_interval()
+
+ interval = property(_get_interval, _set_interval)
+
+ def _get_single_shot(self):
+ return self._single
+
+ def _set_single_shot(self, ss=True):
+ self._single = ss
+ self._timer_set_single_shot()
+
+ single_shot = property(_get_single_shot, _set_single_shot)
+
+ def add_callback(self, func, *args):
+ '''
+ Register `func` to be called by timer when the event fires. Any
+ additional arguments provided will be passed to `func`.
+ '''
+ self.callbacks.append((func, args))
+
+ def remove_callback(self, func, *args):
+ '''
+ Remove `func` from list of callbacks. `args` is optional and used
+ to distinguish between copies of the same function registered to be
+ called with different arguments.
+ '''
+ if args:
+ self.callbacks.remove((func, args))
+ else:
+ funcs = [c[0] for c in self.callbacks]
+ if func in funcs:
+ self.callbacks.pop(funcs.index(func))
+
+ def _timer_set_interval(self):
+ 'Used to set interval on underlying timer object.'
+ pass
+
+ def _timer_set_single_shot(self):
+ 'Used to set single shot on underlying timer object.'
+ pass
+
+ def _on_timer(self):
+ '''
+ Runs all function that have been registered as callbacks. Functions
+ can return False if they should not be called any more. If there
+ are no callbacks, the timer is automatically stopped.
+ '''
+ for func,args in self.callbacks:
+ ret = func(args)
+ if ret == False:
+ self.callbacks.remove((func,args))
+
+ if len(self.callbacks) == 0:
+ self.stop()
+
+
 class Event:
 """
 A matplotlib event. Attach additional attributes as defined in
@@ -1455,7 +1586,6 @@
 event = IdleEvent(s, self, guiEvent=guiEvent)
 self.callbacks.process(s, event)
 
-
 def draw(self, *args, **kwargs):
 """
 Render the :class:`~matplotlib.figure.Figure`
@@ -1799,6 +1929,14 @@
 """
 return self.callbacks.disconnect(cid)
 
+ def new_timer(self):
+ """
+ Creates a new backend-specific subclass of :class:`backend_bases.Timer`.
+ This is useful for getting periodic events through the backend's native
+ event loop. Implemented only for backends with GUIs.
+ """
+ return TimerBase()
+
 def flush_events(self):
 """
 Flush the GUI events for the figure. Implemented only for
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8258
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8258&view=rev
Author: ryanmay
Date: 2010年04月20日 20:02:38 +0000 (2010年4月20日)
Log Message:
-----------
Fix dumb bug in timer calling callbacks with args.
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年04月20日 20:01:28 UTC (rev 8257)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年04月20日 20:02:38 UTC (rev 8258)
@@ -984,7 +984,7 @@
 are no callbacks, the timer is automatically stopped.
 '''
 for func,args in self.callbacks:
- ret = func(args)
+ ret = func(*args)
 if ret == False:
 self.callbacks.remove((func,args))
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8272
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8272&view=rev
Author: ryanmay
Date: 2010年04月26日 19:10:40 +0000 (2010年4月26日)
Log Message:
-----------
Make the TimerBase start/stop implementations just simple pass instead of raising NotImplementedError. This allows creating the timers for BackendAgg, which can simplify some cases.
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年04月26日 19:10:18 UTC (rev 8271)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年04月26日 19:10:40 UTC (rev 8272)
@@ -930,14 +930,10 @@
 self._timer_stop()
 
 def _timer_start(self):
- #TODO: Could we potentially make a generic version through
- #the use of Threads?
- raise NotImplementedError('Needs to be implemented by subclass.')
+ pass
 
 def _timer_stop(self):
- #TODO: Could we potentially make a generic version through
- #the use of Threads?
- raise NotImplementedError('Needs to be implemented by subclass.')
+ pass
 
 def _get_interval(self):
 return self._interval
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8380
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8380&view=rev
Author: efiring
Date: 2010年06月04日 22:06:07 +0000 (2010年6月04日)
Log Message:
-----------
[2901582] Don't fail if the previous LocationEvent was in a canvas that no longer exists.
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年06月04日 20:57:33 UTC (rev 8379)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年06月04日 22:06:07 UTC (rev 8380)
@@ -1069,12 +1069,13 @@
 
 class LocationEvent(Event):
 """
- A event that has a screen location
+ An event that has a screen location
 
 The following additional attributes are defined and shown with
- their default values
+ their default values.
 
- In addition to the :class:`Event` attributes, the following event attributes are defined:
+ In addition to the :class:`Event` attributes, the following
+ event attributes are defined:
 
 *x*
 x position - pixels from left of canvas
@@ -1148,8 +1149,16 @@
 last = LocationEvent.lastevent
 if last.inaxes!=self.inaxes:
 # process axes enter/leave events
- if last.inaxes is not None:
- last.canvas.callbacks.process('axes_leave_event', last)
+ try:
+ if last.inaxes is not None:
+ last.canvas.callbacks.process('axes_leave_event', last)
+ except:
+ pass
+ # See ticket 2901582.
+ # I think this is a valid exception to the rule
+ # against catching all exceptions; if anything goes
+ # wrong, we simply want to move on and process the
+ # current event.
 if self.inaxes is not None:
 self.canvas.callbacks.process('axes_enter_event', self)
 
@@ -1158,12 +1167,12 @@
 if self.inaxes is not None:
 self.canvas.callbacks.process('axes_enter_event', self)
 
-
 LocationEvent.lastevent = self
 
 
 
 
+
 class MouseEvent(LocationEvent):
 """
 A mouse event ('button_press_event', 'button_release_event', 'scroll_event',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8394
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8394&view=rev
Author: efiring
Date: 2010年06月07日 18:29:09 +0000 (2010年6月07日)
Log Message:
-----------
In a collection, if there is no facecolor, take alpha from edgecolor rgba, if available.
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年06月07日 14:23:58 UTC (rev 8393)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年06月07日 18:29:09 UTC (rev 8394)
@@ -300,7 +300,10 @@
 if Nfacecolors:
 rgbFace = facecolors[i % Nfacecolors]
 if Nedgecolors:
- gc0.set_foreground(edgecolors[i % Nedgecolors])
+ fg = edgecolors[i % Nedgecolors]
+ if Nfacecolors == 0 and len(fg)==4:
+ gc0.set_alpha(fg[3])
+ gc0.set_foreground(fg)
 if Nlinewidths:
 gc0.set_linewidth(linewidths[i % Nlinewidths])
 if Nlinestyles:
@@ -309,7 +312,7 @@
 if rgbFace[3] == 0:
 rgbFace = None
 else:
- gc0.set_alpha(rgbFace[-1])
+ gc0.set_alpha(rgbFace[3])
 rgbFace = rgbFace[:3]
 gc0.set_antialiased(antialiaseds[i % Naa])
 if Nurls:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8478
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8478&view=rev
Author: ryanmay
Date: 2010年06月30日 16:31:23 +0000 (2010年6月30日)
Log Message:
-----------
Force timer interval to int. This silences an exception for Tk and a warning from GTK when a float is given.
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年06月29日 21:44:19 UTC (rev 8477)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年06月30日 16:31:23 UTC (rev 8478)
@@ -944,6 +944,9 @@
 return self._interval
 
 def _set_interval(self, interval):
+ # Force to int since none of the backends actually support fractional
+ # milliseconds, and some error or give warnings.
+ interval = int(interval)
 self._interval = interval
 self._timer_set_interval()
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
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 によって変換されたページ (->オリジナル) /