Coloring with coordinates.

1 view (last 30 days)
Kimhim Chhay
Kimhim Chhay on 19 Nov 2019
Commented: Kimhim Chhay on 21 Nov 2019
Hi I have a some x data with upper and lower y data and wanted to color the enclosed section that is made.
Here is the code so far.
x_data = [3/8 4 8 16 30 50 100];
uppery = [100 100 100 85 60 30 10];
lowery = [100 95 80 50 25 5 0];
semilogx(x_data, uppery, x_data, lowery);

Accepted Answer

KSSV
KSSV on 20 Nov 2019
Edited: KSSV on 20 Nov 2019
x_data = [3/8 4 8 16 30 50 100];
uppery = [100 100 100 85 60 30 10];
lowery = [100 95 80 50 25 5 0];
x = [x_data fliplr(x_data)] ;
y = [uppery fliplr(lowery)] ;
semilogx(x,y);
hold on
fill(10.^log10(x),y,'y')

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!