二次元プロットのxの変域の着色
Mostrar comentarios más antiguos
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

Respuesta aceptada
Más respuestas (1)
Etsuo Maeda
el 26 de Dic. de 2019
areaでも横軸0~10の範囲で着色されているはずですが・・・?
y = 0.0:0.01:5.0;
としてためしてみてはどうでしょうか。
Categorías
Más información sobre 表面、ボリュームおよび多角形 en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!