How to label the longitudinal axis with positive and negative values ?

3 views (last 30 days)
Hi,
I have plot the part of world map from lattitude region [30 deg, -30d eg] and longitude region [130deg , -130 deg]
In my plot the lattitude region is fine but I want to modify the lables on the longitude regions. On the right side of the 180deg I wan to lable as - 170, - 160, -150 , -140, and -130 deg. While on the left side of 180deg I want the x axis display +170, +160, +150 , +140, and +130. Also any suggestion how I can remove the scale displayed as 2000 km and 1000 mi.
Im new to matlab and any suggetons will be kindly appreciated.Thanking in advance.
Im attaching my codes and the graph.
load coastlines
geoplot(coastlat,coastlon,"b", 'LineWidth' ,1)
geobasemap topographi
geolimits([-30 30],[130 -130])
box on
ax = gca;
ax.LineWidth = 2;

Accepted Answer

Chunru
Chunru on 11 Sep 2022
load coastlines
geoplot(coastlat,coastlon,"b", 'LineWidth' ,1)
geobasemap topographi
geolimits([-30 30],[130 -130])
box on
ax = gca;
ax.LineWidth = 2;
ax.LongitudeAxis.TickLabels = string(wrapTo180(ax.LongitudeAxis.TickValues))+"^\circ";
ax.TickLabelFormat = "-dms";
ax.Scalebar.Visible = "off";

More Answers (0)

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!