二次元プロットのxの変域の着色
Ältere Kommentare anzeigen
xの変域に対して着色したいのですが、
area 関数を用いると以下のようになり、yの変域にしか着色できません。
例えば
の範囲に着色したい場合はどのようにすればよいでしょうか。
の範囲に着色したい場合はどのようにすればよいでしょうか。clear
close all
% Sample data
y = 0.0:0.01:10.0;
y = y';
x1 = 0.*y + 7.0;
x2 = 0.*y + 4.0;
figure
ar = area(y,[x2,x1]);
% Appearances
set(ar(1),'FaceColor','None')
set(ar(2),'FaceColor',[0.0,0.2,1.0],'FaceAlpha',0.2);
grid on

Akzeptierte Antwort
Weitere Antworten (1)
Etsuo Maeda
am 26 Dez. 2019
areaでも横軸0~10の範囲で着色されているはずですが・・・?
y = 0.0:0.01:5.0;
としてためしてみてはどうでしょうか。
Kategorien
Mehr zu 表面、ボリュームおよび多角形 finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!