I want to build different locations on a map of New York State. My current code describes all of North America because I could not find how to build only one state. I'm trying to set latitude and longitude limits in New York State, but it still gives me the whole country.
Also, when I do hold all(or hold on) and try to build the dots, I get another shape that appears with the specified name, but just an empty white square.
Another related question is that, as soon as I get the pledged points, I need to know what they have. If I have names in a separate array of cells, how can I outline MATLAB labels based on which the coordinates (which are stored in a separate column) correspond to the name (if the names are stored in another column)?
%% Plot map
latlim = [39 47];
lonlim = [-81 -70];
ax = worldmap('USA');
load coast
geoshow(ax, lat, long,...
'DisplayType', 'polygon', 'FaceColor', [.45 .60 .30])
states = shaperead('usastatelo', 'UseGeoCoords', true, 'BoundingBox', [lonlim' latlim']);
axesm('lambert', 'MapLatLimit', latlim, 'MapLonLimit', lonlim);
faceColors = makesymbolspec('Polygon',...
{'INDEX', [1 numel(states)], 'FaceColor', ...
polcmap(numel(states))}); % NOTE - colors are random
geoshow(ax, states, 'DisplayType', 'polygon', ...
'SymbolSpec', faceColors);
figure('Color', 'white')
title('PM2.5 Site in New York State in 2012');
hold all
% Plot points
axesm('lambert', 'MapLatLimit', latlim', 'MapLonLimit', lonlim');
datalat = str2double(datalat);
datalon = str2double(datalon);
scatterm(datalat, datalon)