二次元プロットのxの変域の着色
Show older comments
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

Accepted Answer
More Answers (1)
Etsuo Maeda
on 26 Dec 2019
areaでも横軸0~10の範囲で着色されているはずですが・・・?
y = 0.0:0.01:5.0;
としてためしてみてはどうでしょうか。
Categories
Find more on 表面、ボリュームおよび多角形 in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!