Fri 23 Jul 2010 07:54:58 AM UTC, comment #5:
I think your interpretation of "doing the right thing" is misguided. Matlab reverses the 'ydir' on images for a very good reason.
If you work on image processing you often have a work-flow where some you have an algorithm that detects certain points in an image (like the eyes in a face). Since we represent images as matrices, these detected points are represented as (row, column). Now, if you show an image and then want to plot the detected points on top of the image (for verification purposes), you simply do this
imshow (im)
hold on
plot (column, row, '*')
hold off
You can do this because the 'ydir' is reversed. Had that not been the case, you would have to do something like
imshow (im)
hold on
plot (column, size (im, 1) - row, '*')
hold off
or something like that. This would be a terrible working process.
My point is just that 'ydir' is reversed on purpose.
Now to answer your questions:
1) The line goes from upper left to lower right as it should.
2) Your commands return
>> children = get(gcf, 'children')
children =
173.0011
>> get (children, 'type')
ans =
axes
3) The command doesn't work
>> handles = get(gca);
>> get(handles, 'ydata')
??? Error using ==> get
Conversion to double from struct is not possible.
I don't know how to test what you wanted to test so I cannot do that. Sorry :-(
|