How to get the patch function to fill in between 2 lines ?
显示 更早的评论
I am trying ti shade the space between an upper and lower limit. Time is a categorical variable so I created 'x' as a numerical array of the same length. But when i plot, it splits the graph into polygons but doesn't fill them. Can someone help with where I'm going wrong?
plot(time,y1);
hold on
plot(time,y2);
x = (1:1:12)';
patch([x fliplr(x)].',[y1 fliplr(y2)].','b');
1 个评论
Ameer Hamza
2020-11-11
Without the variables used in this code, it is difficult to see the issue.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Polygons 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
