|
From: <ef...@us...> - 2009-12-22 23:43:16
|
Revision: 8052
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8052&view=rev
Author: efiring
Date: 2009-12-22 23:43:09 +0000 (Tue, 22 Dec 2009)
Log Message:
-----------
pyplot.spy should set current image only if it is making an image
Modified Paths:
--------------
trunk/matplotlib/boilerplate.py
trunk/matplotlib/lib/matplotlib/pyplot.py
Modified: trunk/matplotlib/boilerplate.py
===================================================================
--- trunk/matplotlib/boilerplate.py 2009-12-22 19:49:49 UTC (rev 8051)
+++ trunk/matplotlib/boilerplate.py 2009-12-22 23:43:09 UTC (rev 8052)
@@ -86,7 +86,7 @@
'semilogx',
'semilogy',
'specgram',
- 'spy',
+ #'spy',
'stem',
'step',
'vlines',
@@ -111,7 +111,7 @@
'pcolor' : 'sci(%(ret)s)',
'pcolormesh': 'sci(%(ret)s)',
'imshow' : 'sci(%(ret)s)',
- 'spy' : 'sci(%(ret)s)',
+ #'spy' : 'sci(%(ret)s)', ### may return image or Line2D
'quiver' : 'sci(%(ret)s)',
'specgram' : 'sci(%(ret)s[-1])',
Modified: trunk/matplotlib/lib/matplotlib/pyplot.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/pyplot.py 2009-12-22 19:49:49 UTC (rev 8051)
+++ trunk/matplotlib/lib/matplotlib/pyplot.py 2009-12-22 23:43:09 UTC (rev 8052)
@@ -1600,6 +1600,27 @@
addendum = docstring.Appender(msg, '\n\n')
return lambda func: addendum(docstring.copy_dedent(base)(func))
+
+# This function cannot be generated by boilerplate.py because it may
+# return an image or a line.
+@autogen_docstring(Axes.spy)
+def spy(Z, precision=0, marker=None, markersize=None, aspect='equal', hold=None, **kwargs):
+ ax = gca()
+ # allow callers to override the hold state by passing hold=True|False
+ washold = ax.ishold()
+
+ if hold is not None:
+ ax.hold(hold)
+ try:
+ ret = ax.spy(Z, precision, marker, markersize, aspect, **kwargs)
+ draw_if_interactive()
+ finally:
+ ax.hold(washold)
+ if isinstance(ret, cm.ScalarMappable):
+ sci(ret)
+ return ret
+
+
## Plotting part 2: autogenerated wrappers for axes methods ##
# This function was autogenerated by boilerplate.py. Do not edit as
@@ -2252,24 +2273,7 @@
sci(ret[-1])
return ret
-# This function was autogenerated by boilerplate.py. Do not edit as
-# changes will be lost
-@autogen_docstring(Axes.spy)
-def spy(Z, precision=0, marker=None, markersize=None, aspect='equal', hold=None, **kwargs):
- ax = gca()
- # allow callers to override the hold state by passing hold=True|False
- washold = ax.ishold()
- if hold is not None:
- ax.hold(hold)
- try:
- ret = ax.spy(Z, precision, marker, markersize, aspect, **kwargs)
- draw_if_interactive()
- finally:
- ax.hold(washold)
- sci(ret)
- return ret
-
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
@autogen_docstring(Axes.stem)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|