二次元プロットのxの変域の着色
Afficher commentaires plus anciens
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

Réponse acceptée
Plus de réponses (1)
Etsuo Maeda
le 26 Déc 2019
areaでも横軸0~10の範囲で着色されているはずですが・・・?
y = 0.0:0.01:5.0;
としてためしてみてはどうでしょうか。
Catégories
En savoir plus sur 表面、ボリュームおよび多角形 dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!