最佳答案
这是使用区域
的方法:
% generate "data"
x=1:100;
y1=0.5*ones(100,1);
y2=exp(-(x(:)-50).^2/500).^.5+0.1*rand(100,1);
% do the plot
h=area([y1(:) , (y2(:)-y1(:)).* (y2(:)>y1(:)) ]);
h(1).FaceColor=[1 1 1];
h(2).FaceColor=[0 0 1 ];
hold on;
plot(x,y2,'b',x,y1,'r');
关于matlab - 直线和绘图之间的阴影区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66074491/