Fill the patch between 2 X limits
显示 更早的评论
Hello, I got Picture 1 and my goal was to create Picture 2 ideally, if not possible Picture 3. My objective is to create a legend for the red part of the plot, ideally, an arrow between the 2 limits would be awesome. Thanks
I am open to other suggestion to make a legend of that specific part. Thank you
figure
%Plot something
plot(1:10)
% Add lines
h1 = line([2 2],[1 10]);
h2 = line([5 5],[1 10]);
% Set properties of lines
set([h1 h2],'Color','k','LineWidth',2)
% Add a patch
patch([2 5 5 2],[1 1 10 10],'red')
采纳的回答
更多回答(1 个)
Sagar Shah
2019-2-27
0 个投票
Did you get proper answer or code for that? Currently, I need the same arrow indication as you needed.
Can you please share information?
2 个评论
Tiago Dias
2019-2-27
Walter Roberson
2019-2-27
The File Exchange contribution I posted a link to converts coordinates to make it possible to use data coordinates instead of figure coordinates.
类别
在 帮助中心 和 File Exchange 中查找有关 Polygons 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!