受帝国的古老时代(图片来自here)的启发,我想创建一个在绘制线处将窗格分成两种颜色的图。如何才能做到这一点?
代码:
separator=randi(100,1,20);
figure; hold on; plot(separator);
%below the separator it should be blue, above red

发布于 2020-02-15 02:03:20
感谢@Wolfie,他帮我解决了这个问题
y_max = 100;
separator=randi(y_max,1,20);
figure; hold on; area([separator;y_max-separator]');

https://stackoverflow.com/questions/60229252
复制相似问题