Data cursor: Let Y coordinate increase instead of decrease (moving from bottom to top)
Show older comments
Dear all,
I have a screenshot of Google maps and I want to obtain the coordinates of the stars on the image.
I used Tools > Data Cursor and what I got was this:

Now the problem is, when you go more to right in the image, the X coordinate increases. But when you go up in the images, the Y coordinate decreases (instead of increasing).
How can I change this? At the end I need a list of all the coordinates.
Thank you!
Regards,
Answers (1)
Flip your image in the vertical dimension before plotting it, e.g.
figure; hAxes = gca; imagesc( hAxes, flip( myImage, 1 ) );
then use
set( hAxes, 'YDir', 'normal' )
where hAxes is your axes handle.
4 Comments
corneel
on 16 Jun 2017
Adam
on 16 Jun 2017
You can't change the data cursor points once they are picked. I can't remember off-hand if you can get data cursor points afterwards either, I only ever use a couple at any time.
You would have to put my command before plotting so yes you would lose all the picks.
Is it that important that they increase in that direction?
If you are able to get hold of them then you can just subtract all the y values from the maximum to flip them round.
corneel
on 18 Jun 2017
Adam
on 19 Jun 2017
The maximum should just be the number of rows in your image if you didn't plot it with any specific y values.
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!