labelling longitude/latitude of pcolor worldmap

6 次查看(过去 30 天)
hey, i have created a pcolor world map and i would like to label the longitude and latitude in that way: longitude (5o degree east, 150 degree east, 110 degree west) and the latitude (80 degree south, 40 degree south,0degree, 40 degree north, 80 degree north). how can i do this? can somebody help me with a code? that would be great!!

回答(1 个)

ag
ag 2024-11-5,11:32
编辑:ag 2024-11-5,11:32
Hi Anne,
To label the longitude and latitude on a "pcolor" plot in MATLAB with specific labels like "5° East," "150° East," "110° West," and so on, you can customize the tick labels of the axes. Here's how you can achieve this:
  1. Set the tick positions for both the x-axis (longitude) and y-axis (latitude).
  2. Customize the tick labels to display the desired text.
The below code snippet demonstrates the above steps:
% Set the tick positions
xticks([-110, 5, 150]);
yticks([-80, -40, 0, 40, 80]);
% Set the tick labels
xticklabels({'110° West', '5° East', '150° East'});
yticklabels({'80° South', '40° South', '0°', '40° North', '80° North'});
For more details, please refer to the following MathWorks documentations:
Hope this helps!

类别

Help CenterFile Exchange 中查找有关 Geographic Plots 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by