【发布时间】:2017-02-27 03:05:59
【问题描述】:
我创建了以下地图,它有一个均匀的灰色网格,经线和纬线的间隔均为 1°:
我还希望每 5° 间隔(同时保持 1° 网格)使经线和纬线更粗且黑色,以便网格线与纬度和经度标签匹配,如下所示:
我知道 MATLAB 有 major and minor grids 用于标准 2D 绘图,我过去曾使用过它们。但是,据我所知,地图没有这个功能。
我认为我想做的可以通过访问地图对象属性(使用gcm 或getm)并为经络和纬线的特定子集指定黑色属性(使用setm)来实现.也许函数gridm 或axesm 可以处理这个问题,但我不确定。
实际上,我不知道该怎么做,因为我对地图没有任何经验。非常感谢您的帮助。
代码:
注意:此代码需要Mapping Toolbox。
% Read vector features and attributes from shapefile.
landareas = shaperead('landareas.shp', 'UseGeoCoords', true);
% Define map axes and set map properties.
axesm ('lambert',...
'MapLonLimit', [-70 10],...
'MapLatLimit', [30 70],...
'MapParallels', [38.00555556 71.01111111],...
'Frame', 'on',...
'FLineWidth', 1,...
'Grid', 'on',...
'GLineStyle', '-',...
'GLineWidth', 0.1,...
'GColor', [.7 .7 .7]);
% Display map latitude and longitude data.
geoshow(landareas, 'FaceColor', [1 1 .5], 'EdgeColor', [.3 .3 .3]);
% Toggle and control display of graticule lines.
gridm('MLineLocation', 1,...
'MLabelLocation', 5,...
'PLineLocation', 1,...
'PLabelLocation', 5);
% Toggle and control display of meridian labels.
mlabel on;
% Toggle and control display of parallel labels.
plabel on;
axis off;
【问题讨论】:
-
确实存在一个Geographic Information Systems StackExchange 站点。
标签: matlab plot matlab-figure geo gridlines