現在この提出コンテンツをフォロー中です。
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます
Instead of adding a legend manually and making sure the colors are consistent, use the 'Tag' property for each plot to separate them. Then use the function add_legend to add a legend. The function groups all plots based on their Tag property, and give each group a separate color. It uses the Tag property values as labels in the legend.
I have included the function varycolor by Daniel Helmick:
https://www.mathworks.com/matlabcentral/fileexchange/21050-varycolor
引用
Hannes Mogensen (2026). Add Legend Automatically Based on Tag Property Value (https://jp.mathworks.com/matlabcentral/fileexchange/58456-add-legend-automatically-based-on-tag-property-value), MATLAB Central File Exchange. に取得済み.
謝辞
ヒントを得たファイル: varycolor
| バージョン | 公開済み | リリース ノート | Action |
|---|---|---|---|
| 1.0.0.0 | Added credit to Daniel Helmick Updated description |
