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 Center および File ExchangeGeographic Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by