line color in figure
4 次查看(过去 30 天)
显示 更早的评论
回答(1 个)
Stephen23
2017-1-30
编辑:Stephen23
2017-1-30
If you plot all of the lines at once then they will automatically be colored using the axes ColorOrder:
N = 16;
A = linspace(0,pi,N);
X = cos(A);
Y = sin(A);
X(2,:) = 0;
Y(2,:) = 0;
plot(X,Y)
axis equal
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176937/image.png)
The documentation explains how the ColorOrder can be changed:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Colormaps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!