If you record the handles of the rectangle calls then you can legend() those specifically
rectangle with color description
4 次查看(过去 30 天)
显示 更早的评论
Hello,
I'm using a
rectangle
function to draw some color specification on my plots. I'd like to specify what is the meaning of each color. For example lets say there is only
a=1:10;
plot(a)
on the figure and 3 background colors drawn with the rectangle function
rectangle('Position' [1,1,2,10], 'FaceColor', 'r')
rectangle('Position' [4,1,2,10], 'FaceColor', 'g')
rectangle('Position' [7,1,2,10], 'FaceColor', 'k')
I'd like to mention what is the meaning of r g and k. How can I do that?
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Legend 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!