Shade the region above the graph
10 ビュー (過去 30 日間)
古いコメントを表示
I am trying to shade the region to above the graph. Does anyone know how to go about doing that? It would be a great help.
Thanks
My code is attached below
% Maximum speed
rho = 0.002378; % at sea level
Vmax = 987.48;
K = 0.0397887;
rho30 = 0.00089;
rhos = 0.374; % sigma
WS = 0:0.1:160;
TWvmax = ((1.23488./WS)+(0.000414*WS));
plot(WS,TWvmax,'--r')
hold on
text(60,-0.01,'Maximum speed')
0 件のコメント
回答 (1 件)
Star Strider
2020 年 9 月 21 日
Try this:
% Maximum speed
rho = 0.002378; % at sea level
Vmax = 987.48;
K = 0.0397887;
rho30 = 0.00089;
rhos = 0.374; % sigma
WS = 0:0.1:160;
TWvmax = ((1.23488./WS)+(0.000414*WS));
plot(WS,TWvmax,'--r')
hold on
ixf = isfinite(TWvmax);
patch([WS(ixf) fliplr(WS(ixf))], [TWvmax(ixf) ones(size(TWvmax(ixf)))*max(TWvmax(ixf))], 'b', 'EdgeColor','none', 'FaceAlpha',0.5)
hold off
text(60,-0.01,'Maximum speed')
ylim([-1 max(ylim)])
Note that ‘TWvmax’ contains at least one infinite value, so it is necessasry to eliminate it to draw the patch object.
.
3 件のコメント
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!