Coloring with coordinates.

1 Ansicht (letzte 30 Tage)
Kimhim Chhay
Kimhim Chhay am 19 Nov. 2019
Kommentiert: Kimhim Chhay am 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);

Akzeptierte Antwort

KSSV
KSSV am 20 Nov. 2019
Bearbeitet: KSSV am 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')

Weitere Antworten (0)

Kategorien

Mehr zu Lighting, Transparency, and Shading finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by