labelling longitude/latitude of pcolor worldmap

조회 수: 2 (최근 30일)
anne d.
anne d. 2015년 7월 14일
편집: ag 2024년 11월 5일
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일
편집: ag 2024년 11월 5일
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에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by