plot filled rectangle and appear on legend
68 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I'd like to have something like that

I know that I can use rectangle function, but then it is not appearing on a legend.
Any suggestions how to solve the issue?
0 件のコメント
採用された回答
Walter Roberson
2020 年 11 月 29 日
Use fill() such as
fill([xmin xmax xmax xmin], [ymin ymin ymax ymax], 'facecolor', 'y')
2 件のコメント
Walter Roberson
2020 年 12 月 13 日
Record the handle of one of the fill() calls. Pass only that handle to legend() (along with the handles of any other objects you do wish to legend() )
その他の回答 (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!