"Dave " <firstname.lastname@example.org> wrote in message <email@example.com>... > I am using patch to generate many polygons with different colors, where each color represents a value. > > I would like to be able to click on a polygon and print what that value is in the command window. I'm attempting to do this by writing a callback for ButtonDownFcn.
I'm trying to do the same sort of thing: I need to know which polygon in a patch was hit and where the hit point is. I looked at datacursormode, and it only tells me the hit point, not the polygon; besides which, it insists on displaying the hit point on the screen, which I don't want.
Matlab must have calculated this information to detect the hit. Is there any way to make it pass it on to me?