在MATLAB中绘制带有城市名称标签的地图

时间:2014-08-19 03:59:22

标签: matlab

我想绘制带有城市名称标签的地图。我知道如何从shapefile中绘制多边形但是如何用地名标注它?这些是在shapefile中还是zipfile中包含的其他文件之一?

my_map = shaperead('myshapefile.shp');

Zone1 = rgb('Red');
Zone2 = rgb('Purple');
Zone3 = rgb('Orange');
Zone4 = rgb('Yellow');
Zone5 = rgb('SpringGreen');
Zone6 = rgb('DeepSkyBlue'); 

mapColors = makesymbolspec('Polygon',{'GRID_CODE',1,'Facecolor',Zone1,'FaceAlpha',0.5},...
    {'GRID_CODE',2,'Facecolor',Zone2,'FaceAlpha',0.5},{'GRID_CODE',3,'Facecolor',Zone3,'FaceAlpha',0.5},{'GRID_CODE',4,'Facecolor',Zone4},...
    {'GRID_CODE',5,'Facecolor',Zone5,'FaceAlpha',0.5},{'GRID_CODE',6,'Facecolor',Zone6,'FaceAlpha',0.5});

mapshow(my_map,'SymbolSpec',mapColors,my_labels);

axis off

0 个答案:

没有答案