How to shade a portion of a graph

6 ビュー (過去 30 日間)
Kyle Langford
Kyle Langford 2022 年 3 月 5 日
コメント済み: Kyle Langford 2022 年 3 月 5 日
How can I shade under the curve, and after x=1.25?
x=[-3:.1:3]; %
Y=normpdf(x,0,1);
plot(x,Y,'b')
xlim([-3 3])
ylim([0 0.4])
hold on
index=[1.25:3] %area i want shaded
fill(x,Y,index,'g')

採用された回答

David Hill
David Hill 2022 年 3 月 5 日
x=[-3:.1:3]; %
Y=normpdf(x,0,1);
plot(x,Y,'b')
xlim([-3 3])
ylim([0 0.4])
hold on
area(x(x>=1.25),Y(x>=1.25),0,'EdgeColor','none','FaceColor','b')
  1 件のコメント
Kyle Langford
Kyle Langford 2022 年 3 月 5 日
Thank you!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCurve Fitting Toolbox についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by