How to not display the first item in map legend?
2 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I am trying to plotm two sets of locations onto a map, with legend. However, it seemed like I can not get rid of the first thick black line off, which came from the the command worldmap. I have tried to turn off the handle visibility of the frame, put in the frame lastly so that it would appear in the legend lastly (thus easily ignored), or skip the first item, but all returned funny map.
Attached at the end is the code I am using.
figure
worldmap ([ymin ymax],[xmin xmax])
title ('mytitle')
geoshow('landareas.shp','FaceColor',[0.7 0.8 0.6])
hold on
%plot lats and lons from 1960s and 1990s and represent them in different
%colour
plotm(x1,y1,'.',...
'MarkerEdgeColor',[0.9 0.3 0.5])
plotm(x2,y2,'.',...
'MarkerEdgeColor',[0.2 0.4 0.6])
hold off
legend('','dataset1','dataset2')
Please help me to get rid of the first item of my legend :)
Thanks in advance
0 件のコメント
採用された回答
Satoshi Kobayashi
2019 年 2 月 3 日
figure
worldmap ([ymin ymax],[xmin xmax])
title ('mytitle')
geoshow('landareas.shp','FaceColor',[0.7 0.8 0.6])
hold on
%plot lats and lons from 1960s and 1990s and represent them in different
%colour
p1 = plotm(x1,y1,'.',...
'MarkerEdgeColor',[0.9 0.3 0.5])
p2 = plotm(x2,y2,'.',...
'MarkerEdgeColor',[0.2 0.4 0.6])
hold off
legend([p1 p2],'dataset1','dataset2')
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Legend についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!