Varying Marker Color by Variable with plotm
Afficher commentaires plus anciens
Hello - please forgive my lack of experience with coding, but I am having trouble with some mapping I am trying to do. I am able to plot the locations of a series of samples the data for which comes from a spreadsheet (icee.xlsx) that I have MATLAB read. I would like the marker face colors to correspond to the value of a column of the spreadsheet, (in my code, this would be table.low_range). Currently, I am plotting all of the markers with the same color (line 22 of the below).
Can you please tell me how to change the code below in order to fit a colorbar to the table.low_range variable and vary the face colors of the markers according to it? I have attached a sample of the spreadsheet in question should that help.
clear all
table = readtable('icee.xlsx');
figure;
clf;
%center on the south pole
gisplat=-90;
gisplon=180;
xl=[-.45 .45];
yl=[-.35 .35];
tx=xl(1)+.95*diff(xl);
ty=yl(1)+.06*diff(yl);
ts=14;
mw=.005;
awx=(1-5*mw)/4;
awy=(1-2*mw);
axesm('mapprojection','eqdazim','origin',[gisplat gisplon 0]);
g1=geoshow('landareas.shp');
set(get(g1,'children'),'facecolor',[.9 .9 .9]);
set(gca,'xlim',xl);
set(gca,'ylim',yl);
hold on;
plotm(table.latitude,table.longitude,'ko','markerfacecolor',[.7 .7 1]);
set(gca,'box','off','xcolor',[1 1 1],'ycolor',[1 1 1]);
hg=gridm('on');
set(hg,'clipping','on');
set(hg,'linestyle','-','color',[.75 .75 .75]);
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Wireless Communications dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
