How to color RED to the lower portion of the curve
2 次查看(过去 30 天)
显示 更早的评论
How to color RED to the lower portion of the curve y=x^2
x = 1 : 0.1 : 10;
y = x.^2;
plot(x,y)
axis([1 10 0 100])
0 个评论
采纳的回答
Kye Taylor
2013-4-18
Replace the
plot(x,y)
command with
area(x,y,'FaceColor',[1 0 0])
6 个评论
Kye Taylor
2013-4-19
the first two inputs to patch can be thought of as points that define vertices of some polygon. the vectors x and y are the lower parts of that polygon. By adding a point (0,100) to the set of vertices, we get the top left corner of the polygon. Without that vertex, the behavior was as you said above, only the "upper portion" was colored instead of the "whole upper part".
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surfaces, Volumes, and Polygons 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!