Plot data on a thematic map

1 次查看(过去 30 天)
Luigi
Luigi 2011-11-9
Hi everyone,
I'm quite a newbie to Matlab and I was wondering if you could help me with a certain issue I'm having.
To simplify, I've got a vector (550 X 1 double) that I'd like to plot at a map. Each data should represent a certain attribute of a specific city. The map should be colored (AUTUMN style for example).
I also have a vector (550 X 1) with the codes and the Shape-file wich has the same code for each city.
Now, to be honest, I'm 100% stuck. When I go to mapview and open the shape-file I do see the map but without anydata and singlecolored, I'm not going any further than that. What should be the next steps to see my data in that map?
Thanks a lot in advance!

回答(2 个)

Rob Comer
Rob Comer 2011-11-9
You need to use makesymbolspec. Here's a simple example that constructs and applies a symbol spec for a numerical attribute of a point data set. This example uses geoshow, but you can also use a symbol spec with mapview. First, call makesymbolspec from the command line to add a symbol spec to your workspace. Then, in the "Layers" menu, select your layer (e.g., cities), and select "Set Symbol Spec ..." in the context menu that opens to the right.
tsunamis = shaperead('tsunamis.shp','UseGeoCoords',true);
symspec = makesymbolspec('Point', ...
{'Eq_Mag',[4.5 9.5],'MarkerEdgeColor',autumn(1024)});
worldmap world
load coast
geoshow(lat,long)
geoshow(tsunamis,'SymbolSpec',symspec)
  1 个评论
Luigi
Luigi 2011-11-10
Hi Rob, thanks again for the reply!
Makesymbolspec seems to work just fine to what I need. Thanks!
Therefore, in order to apply it correctly I still need to do another thing first that I don't know exactly how to. I'll explain it.
The shapefile I use has a column named GEOCODE. I saw it in the Attribute Table of the shapefile using a GIS software (BTW, how can I see it in matlab?). At Matlab's workspace there's a VECTOR called CODE and another one called DATA (both have the same size). The question then is: I need to do the "join" GEOCODE-CODE so that I could use DATA and plot it at the map. Could you help me with that?
Then, after doing that I guess Makesymbolspec would fit greatly to color the DATA.
I guess thats it!
Thanks a lot!

请先登录,再进行评论。


Luigi
Luigi 2011-11-10
Hi Rob, thanks a lot for the reply. I'm pretty sure it will help me a lot. I'll try it and let you know.
Kind regards

Community Treasure Hunt

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

Start Hunting!

Translated by