SF.net SVN: matplotlib: [5188] trunk/matplotlib/examples/api/image_zcoord. py
Revision: 5188 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5188&view=rev Author: jdh2358 Date: 2008-05-18 15:31:59 -0700 (Sun, 18 May 2008) Log Message: --- added z coordinate example for nearest neighbor images Added Paths: --- trunk/matplotlib/examples/api/image_zcoord.py Added: trunk/matplotlib/examples/api/image_zcoord.py === --- trunk/matplotlib/examples/api/image_zcoord.py (rev 0) +++ trunk/matplotlib/examples/api/image_zcoord.py 2008-05-18 22:31:59 UTC (rev 5188) @@ -0,0 +1,27 @@ +""" +Show how to modify the coordinate formatter to report the image "z" +value of the nearest pixel given x and y +""" +import numpy as np +import matplotlib.pyplot as plt +import matplotlib.cm as cm + +X = 10*np.random.rand(5,3) + +fig = plt.figure() +ax = fig.add_subplot(111) +ax.imshow(X, cmap=cm.jet, interpolation='nearest') + +numrows, numcols = X.shape +def format_coord(x, y): +col = int(x+0.5) +row = int(y+0.5) +if col>=0 and col=0 and rowhttp://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5189] branches/v0_91_maint/lib/matplotlib/image.py
Revision: 5189 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5189&view=rev Author: jdh2358 Date: 2008-05-18 18:09:09 -0700 (Sun, 18 May 2008) Log Message: --- fixed missing get_filterrad Modified Paths: -- branches/v0_91_maint/lib/matplotlib/image.py Modified: branches/v0_91_maint/lib/matplotlib/image.py === --- branches/v0_91_maint/lib/matplotlib/image.py2008-05-18 22:31:59 UTC (rev 5188) +++ branches/v0_91_maint/lib/matplotlib/image.py2008-05-19 01:09:09 UTC (rev 5189) @@ -324,6 +324,7 @@ def get_filterrad(self): 'return the filterrad setting' +return self._filterrad class NonUniformImage(AxesImage): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5190] trunk/matplotlib
Revision: 5190 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5190&view=rev Author: jdh2358 Date: 2008-05-18 18:10:11 -0700 (Sun, 18 May 2008) Log Message: --- Merged revisions 5189 via svnmerge from https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint r5189 | jdh2358 | 2008-05-18 20:09:09 -0500 (Sun, 18 May 2008) | 1 line fixed missing get_filterrad Modified Paths: -- trunk/matplotlib/lib/matplotlib/image.py Property Changed: trunk/matplotlib/ Property changes on: trunk/matplotlib ___ Name: svnmerge-integrated - /branches/v0_91_maint:1-4816,5172,5178-5179,5181 + /branches/v0_91_maint:1-4816,5172,5178-5179,5181,5189 Modified: trunk/matplotlib/lib/matplotlib/image.py === --- trunk/matplotlib/lib/matplotlib/image.py2008-05-19 01:09:09 UTC (rev 5189) +++ trunk/matplotlib/lib/matplotlib/image.py2008-05-19 01:10:11 UTC (rev 5190) @@ -362,6 +362,7 @@ def get_filterrad(self): 'return the filterrad setting' +return self._filterrad class NonUniformImage(AxesImage): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
