How do I shade the area between two curves on a plot that is generated by arrays?
2 次查看(过去 30 天)
显示 更早的评论
For example:
x1 = [ 1 2 3 ];
y1 = [2 5 8];
x2 = [1 2.5 3.5];
y2 = [1 6 3];
plot(x1, y1)
hold on
plot(x2, y2)
Thanks for the help!
0 个评论
采纳的回答
Davide Masiello
2023-8-2
编辑:Davide Masiello
2023-8-2
x1 = [1 2 3];
y1 = [2 5 8];
x2 = [1 2.5 3.5];
y2 = [1 6 3];
hold on
patch([x1 flip(x2)], [y1 flip(y2)],'y','EdgeColor','none')
plot(x1, y1,'b')
plot(x2, y2,'r')
box on
axis padded
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Scatter Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!