Clear Filters
Clear Filters

Change interval values of lat and lon

6 views (last 30 days)
Brendan Clark
Brendan Clark on 15 Mar 2021
Commented: Brendan Clark on 15 Mar 2021
I am using pcolor to plot geographic data. Doing pcolor(double(Lon),double(Lat),X) displays values of longitude as 0, 50, 100, 150 etc and latitude as 0, 20, 40, 60 etc. How can I change the values of lat and lon displayed so they are in intervals of 30 for longitude (instead of 50) and 15 for latitude (instead of 20)? Will the grid lines also change?
  2 Comments
DGM
DGM on 15 Mar 2021
Ticks and labels are axes properties. You can get a list of what the current settings are by running
get(gca);
You can see what options are are available for these properties by running
set(gca);
For tick locations, you can set them to whatever you want. For example:
set(gca,'xtick',[30 60 90 120],'ytick',[15 30 45 60]);

Sign in to comment.

Answers (1)

Cris LaPierre
Cris LaPierre on 15 Mar 2021
Use the functions xticks and yticks.

Categories

Find more on Geographic Plots 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!