Axes control for geoscatter, set the lat and lon limits and remove unwanted, repeated map geography

43 次查看(过去 30 天)
I am producing a series of map figures showing changing latitude and longitude data throughout the day. I want to set the latitude and longitude limits and keep them the same for all plots, though data may only cover a portion of the map. I am using geoscatter and geolimits, but when I set the limits, excess map area shows outside the map, mainly along the longitude axis and it is a repeat of area already shown. There is no data plotted in the excess, repeated area. These are the basic commands I'm using and a screen shot.
scatFig = geoscatter(latitudeData, longitudeData, 1, scatterData);
set(gca, 'colorscale', 'log');
colormap(jet(10));
geolimits([-70 90], [-179 179])
The plot below shows the axes limits set as I require, but the excess map below 70S and beyond 180E/180W is causing the map itself to contract, reducing the data visibility. I would like to remove the antarctic excess and the repeat of Alaska and eastern Russia. -Thanks

采纳的回答

Rob Comer
Rob Comer 2021-10-29
In your call to geolimits, you specifed latitude limits that extend all the way to the North Pole:
geolimits([-70 90], [-179 179])
However, geoscatter creates a GeographicAxes (geoaxes), which is unsuitable for displaying data north of about 85 degees. That's because it uses a Web Mercator projection in which 90 N maps to +inf in y (and 90 S maps to -inf). For the same reason, there are no basemap tiles for the polar regions ([85 90] and [-90 -85]). There's also some automatic padding of the longitude limits to ensure that the map (both your data and the underlying basemap) continues to fill the axes position in the figure without introducing shape distortions.
If you don't need to map data north of +85, then from what I can see the following limits could work for you:
geolimits([-70 85], [-180 180])
If you want, you can check the actual limits like this:
>> [latlim, lonlim] = geolimits
latlim =
-71.6681 85.0511
lonlim =
-180 180
You can see that there's still a small amount of padding applied, this time in latitude rather than longitude, but it's scarcely noticeable.
If you do need to plot data north of +85, consider using Mapping Toolbox functions such as worldmap, geoshow, and scatterm, which will allow you to plot your data in a more suitable projection.
  1 个评论
Mike Susedik
Mike Susedik 2021-10-29
Thanks for the explanation, it was very informative. I've worked with those other plots and ran into troubles, but I'll revisit. With the changes the longitude seems better behaved too.

请先登录,再进行评论。

更多回答(0 个)

类别

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

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by