フィルターのクリア

how to add legend?

1 回表示 (過去 30 日間)
m. muner
m. muner 2016 年 8 月 15 日
回答済み: Walter Roberson 2016 年 8 月 15 日
hello guys i need help if i have the fallowing plot and i need to add legend but for the small stars and plus the white dots in the cells but when i add the legend it take the colors what should i do ?
  2 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2016 年 8 月 15 日
Where is your code and what is your problem?
m. muner
m. muner 2016 年 8 月 15 日
look i need to add legend for the small stars and pluses inside the hexagons but when i add it it shows the colors of the cells like the legend (color data) is there any way to make the legend data for the stars

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

採用された回答

Walter Roberson
Walter Roberson 2016 年 8 月 15 日
In short: create an extra plot handle for each marker type you want to show up in the legend, recording those handles. Use nan as the x and y coordinates when you do that. legend() passing those handles as the first argument.
legend() by default acts on the first plot handles it finds in the figure. In your case that happens to be the hex tiles. You need to tell more specifically which handles are to be legend()'d

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLegend についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by