Plot MATLAB映射工具箱-如何在创建的地图上绘制纬度/经度坐标?

Plot MATLAB映射工具箱-如何在创建的地图上绘制纬度/经度坐标?,plot,maps,latitude-longitude,matlab,Plot,Maps,Latitude Longitude,Matlab,我用以下代码生成了这张加利福尼亚地图: states = geoshape(shaperead('usastatehi', 'UseGeoCoords', true)); figure ax = usamap('california'); oceanColor = [.5 .7 .9]; setm(ax, 'FFaceColor', oceanColor) geoshow(states) title({ 'California map'}) 现在我想用纬度和经度坐标在地图上画出特定的点。我不能

我用以下代码生成了这张加利福尼亚地图:

states = geoshape(shaperead('usastatehi', 'UseGeoCoords', true));
figure
ax = usamap('california');
oceanColor = [.5 .7 .9];
setm(ax, 'FFaceColor', oceanColor)
geoshow(states)
title({ 'California map'})
现在我想用纬度和经度坐标在地图上画出特定的点。我不能“猜测”,因为我得画100点左右。我该怎么做?我到处找,找不到语法。谢谢

分别使用或,相当于MATLAB的和函数(它们接受相同的“线型规范”)

以下是一个例子:

% California map axes
figure; ax = usamap('california');
setm(ax, 'FFaceColor', [.5 .7 .9])
title('California map')

% read shapefile of US states with names and locations
states = geoshape(shaperead('usastatehi.shp', 'UseGeoCoords', true));

% display map
geoshow(states, 'Parent',ax)

% find states within the shown axes limits (California and Nevada)
latlim = getm(ax, 'MapLatLimit');
lonlim = getm(ax, 'MapLonLimit');
idx = ingeoquad(states.LabelLat, states.LabelLon, latlim, lonlim);

% latitude/longitude coordinates and corresponding labels
lat = states(idx).LabelLat;
lon = states(idx).LabelLon;
txt = states(idx).Name;

% plot coordinates
%plot(lat, lon, 'rx')
linem(lat, lon, 'LineStyle','none', 'LineWidth',2, 'Color','r', ...
    'Marker','x', 'MarkerSize',10)
textm(lat, lon, txt, 'HorizontalAlignment', 'left', 'VerticalAlignment','top')