From: <ry...@us...> - 2009-09-28 22:12:47
|
Revision: 7833 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7833&view=rev Author: ryanmay Date: 2009-09-28 22:12:38 +0000 (Mon, 28 Sep 2009) Log Message: ----------- Update to be compatible with matplotlib trunk's new method of tracking the current image. Modified Paths: -------------- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2009-09-28 21:58:10 UTC (rev 7832) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2009-09-28 22:12:38 UTC (rev 7833) @@ -2567,7 +2567,10 @@ ax.hold(b) # reset current active image (only if pyplot is imported). try: - plt.gci._current = ret + try: + plt.sci(ret) + except AttributeError: + plt.gci._current = ret except: pass # set axes limits to fit map region. @@ -2642,7 +2645,10 @@ ax.hold(b) # reset current active image (only if pyplot is imported). try: - plt.gci._current = ret + try: + plt.sci(ret) + except AttributeError: + plt.gci._current = ret except: pass # set axes limits to fit map region. @@ -2687,7 +2693,10 @@ ax.hold(b) # reset current active image (only if pyplot is imported). try: - plt.gci._current = ret + try: + plt.sci(ret) + except AttributeError: + plt.gci._current = ret except: pass # set axes limits to fit map region. @@ -2724,7 +2733,10 @@ ax.hold(b) # reset current active image (only if pyplot is imported). try: - plt.gci._current = ret + try: + plt.sci(ret) + except AttributeError: + plt.gci._current = ret except: pass # set axes limits to fit map region. @@ -2788,9 +2800,17 @@ # reset current active image (only if pyplot is imported). try: try: # new contour. - if CS._A is not None: plt.gci._current = CS + if CS._A is not None: + try: + plt.sci(CS) + except AttributeError: + plt.gci._current = CS except: # old contour. - if CS[1].mappable is not None: plt.gci._current = CS[1].mappable + if CS[1].mappable is not None: + try: + plt.sci(CS[1].mappable) + except AttributeError: + plt.gci._current = CS[1].mappable except: pass return CS @@ -2863,9 +2883,17 @@ # reset current active image (only if pyplot is imported). try: try: # new contour. - if CS._A is not None: plt.gci._current = CS + if CS._A is not None: + try: + plt.sci(CS) + except AttributeError: + plt.gci._current = CS except: # old contour. - if CS[1].mappable is not None: plt.gci._current = CS[1].mappable + if CS[1].mappable is not None: + try: + plt.sci(CS[1].mappable) + except AttributeError: + plt.gci._current = CS[1].mappable except: pass return CS This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |