filling in between two curves with different x values
7 次查看(过去 30 天)
显示 更早的评论
Hello.
I have a plot
plot(x,y,'r--','LineWidth', 2);
that I want to display with boundaries such that:
plot(x+5,y,'k--','LineWidth', 0.5);
plot(x-5,y,'k--','LineWidth', 0.5);
I want to shade the area in between and have tried:
patch([k-5 k+5], [y y], 'g')
but I can't get it to work.
Thanks for any help.
0 个评论
采纳的回答
Guillaume
2018-3-12
I would think that
patch([x-5, fliplr(x+5)], [y fliplr(y)], 'g')
should work.
8 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polygons 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!