plot filled rectangle and appear on legend
82 次查看(过去 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!