フィルターのクリア

Label Polygons in Mapshow

3 ビュー (過去 30 日間)
CMatlabWold
CMatlabWold 2020 年 5 月 24 日
コメント済み: CMatlabWold 2020 年 5 月 28 日
Hi
I have a shapefile of zip codes of NYC. When I use the code, I get this pic and a structure is created, where zip codes are listed in column 5 of the structure. How can I label these zip codes on the map, where it shows?
Thanks,
Candace
%S = shaperead('ZipCode1.shp','UseGeoCoords',true);
S = shaperead('ZipCode1.shp')
mapshow(S)
  1 件のコメント
CMatlabWold
CMatlabWold 2020 年 5 月 27 日
Thank you! It works. Is there a way to reduce the text size?

サインインしてコメントする。

採用された回答

Sai Sri Pathuri
Sai Sri Pathuri 2020 年 5 月 26 日
編集済み: Sai Sri Pathuri 2020 年 5 月 26 日
You may find internal point of bounding boxes and use text function.
for i=1:263
meanValue = mean(S(i).BoundingBox);
text(meanValue(1),meanValue(2),num2str(S(i).ZIPCODE))
end
  2 件のコメント
Sai Sri Pathuri
Sai Sri Pathuri 2020 年 5 月 27 日
To reduce text size, you may use FontSize name-value pair of text funtion
text(meanValue(1),meanValue(2),num2str(S(i).ZIPCODE),'FontSize',fontsize)
CMatlabWold
CMatlabWold 2020 年 5 月 28 日
Thank you!

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by