Display Pixel intensity

Hi,

has anyone a good idea how to interactively display the xy coordintes (as whole numbers) and the pixel intensity using the mouse cursor. Here is the code snippet:


fig = plt.figure()
ax1 = fig.add_subplot(111)
channel_select = 1
p = imread(filename) # normally I use TIFF file
if (p.ndim > 2):
p1 = p[:,:,channel_select] # if more than 1 channel --> select
else:
p1 = p

ax1.imshow(p1)
plt.show()

So far only the XY coordinates are displayed, but not as whole numbers and even negative xy values are displayed, if the cursor is move to the corners (???). And of course I would like the pixel intensity to be displayed …

Thanks,

Sebi

See

http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg13203.html

http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg13204.html

-JJ

···

On Tue, Feb 23, 2010 at 9:22 AM, Sebastian Rhode <sebrhode@...982...> wrote:

Hi,

has anyone a good idea how to interactively display the xy coordintes (as
whole numbers) and the pixel intensity using the mouse cursor. Here is the
code snippet:

...
fig = plt.figure()
ax1 = fig.add_subplot(111)
channel_select = 1
p = imread(filename) # normally I use TIFF file
if (p.ndim > 2):
p1 = p[:,:,channel_select] # if more than 1 channel --> select
else:
p1 = p

ax1.imshow(p1)
plt.show()
...

So far only the XY coordinates are displayed, but not as whole numbers and
even negative xy values are displayed, if the cursor is move to the corners
(???). And of course I would like the pixel intensity to be displayed ...

Thanks,

Sebi

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users