legend dynamically updated
古いコメントを表示
Hi, my task would be to have a legend which is update dynamically as I loop over some data extracted from different files and I add them to a same plot, for instance. To put it better, I would like to "append" a label to my legend every time I update my plot. Would you know how to do it?
Chiara
4 件のコメント
John Bailey
2018 年 5 月 12 日
編集済み: John Bailey
2018 年 5 月 12 日
plot(Pss,'DisplayName','desired legend entry')
legend('-DynamicLegend')
Place that after your first plot and it will automically put the name of the plot variable into the legend.
Walter Roberson
2018 年 5 月 12 日
Note that dynamic legends did not exist at the time the original question was asked in 2011.
Matthew
2018 年 9 月 25 日
Those were the days.
Moritz Stich
2022 年 3 月 31 日
Jon Bailey you are a dynamic legend. Thanks
採用された回答
その他の回答 (2 件)
Matt Fig
2011 年 3 月 21 日
0 投票
How are you updating the plot? In a loop?
1 件のコメント
rodolfo reyesbaez
2019 年 5 月 21 日
I added a hold on before ending the loop
Chiara Modenese
2011 年 3 月 21 日
カテゴリ
ヘルプ センター および File Exchange で Legend についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!