How to shade with upper and lower limits along a curve line? (see example in image below)
Show older comments
Accepted Answer
More Answers (1)
chicken vector
on 26 Apr 2023
N = 100;
x = linspace(0,2*pi,N);
y = 1 + cos(x);
yNoiseUp = y + 0.5 + .25*(sin(x) + .25*(rand(1,N) - 0.5));
yNoiseDown = y - 0.5 - .25*(sin(x) + .25*(rand(1,N) - 0.5));
figure;
grid on;
hold on;
fill([x flip(x)],[yNoiseUp flip(yNoiseDown)],[.8 .8 .8],'FaceAlpha',.7)
plot(x,y,'k','LineWidth',2);
plot(x,yNoiseUp,'k');
plot(x,yNoiseDown,'k');
hold off;
xlim([0,x(end)]);
xlabel('\theta_3 [deg]')
ylabel('C_{p,3}')
Result:

1 Comment
juan sanchez
on 26 Apr 2023
Categories
Find more on Axis Labels in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
