フィルターのクリア

Shading the area between the minimum and maximumlimits of my data

4 ビュー (過去 30 日間)
B
B 2022 年 3 月 18 日
コメント済み: B 2022 年 3 月 18 日
Hi all,
Please I need someone to help me shade the minimum and maximum limits of my data.
I tried this code but it didn't work
load('Data1.mat')
T=Data1
T=[aa v Vn Vx]
figure
hold all
%plot(T(:,1),T(:,2),'.-r'); % median
%plot(T(:,1),T(:,3),'.-g'); % min
%plot(T(:,1),T(:,4),'.-k'); %max
x2 = [T(:,1), fliplr(T(:,1))];
idx = [T(:, 4), fliplr(T(:,3))];
fill(x2, inBetween, 'g');
Thank you.
KB

採用された回答

Simon Chan
Simon Chan 2022 年 3 月 18 日
flip up down instead of flip left right since they are column vector.
load('Data1.mat')
x2 = [T(:,1); flipud(T(:,1))];
idx = [T(:, 4); flipud(T(:,3))];
fill(x2, idx, 'g');
  1 件のコメント
B
B 2022 年 3 月 18 日
Thanks Simon for this - I really appreciate it.

サインインしてコメントする。

その他の回答 (1 件)

B
B 2022 年 3 月 18 日
Alternatively, this works. we use patch and that also allows us to manipulate colour ntesnisty of the shaded area.
T=Data1
T=[aa v Vn Vx]
figure
hold all
plot(T(:,1),(T(:,4),'-k');
plot(T(:,1),T(:,3),'-r');
patch([T(:,1); flipud(T(:,1))],[T(:,3); flipud(T(:,4)], 'g', 'FaceAlpha',0.2, 'EdgeColor','g');
plot(T(:,1), T(:,2), 'r')
hold off

カテゴリ

Help Center および File ExchangeEnvironmental Engineering についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by