“xtick” and “xticklabel” for matrix

1 view (last 30 days)
Kay
Kay on 25 Feb 2012
hello all,
I need to convert pixel numbers of images to coordinates of a 50x50 matrix using “xtick” and “xticklabel” for X-axis and similar for Y-axis.The image has to show "32° N to 38° N and Longitude is from 112° W to 106° W". the "xtick" command gives me an error in Matlab because of the matrix size. What can I do?
thank you!

Answers (1)

Walter Roberson
Walter Roberson on 25 Feb 2012
You do not use a matrix of xtick or ytick: you use a vector for them.
image([32 38], [106 112], TheMatrix)
set(gca, 'xtick', 32:38, 'Ytick', 106:112)

Categories

Find more on Labels and Annotations 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!