How to change color each loop?
显示 更早的评论
I have a program which should be repeated 5 times by a loop. I used plot() order in my program and I'm eager to change graph color each time. How can I do it?
For example:
plot(ZZ,dTdz3,'.',h,t,'y')
I want to change 'y' to 'm' in the next loop.
note: ZZ and dTdz3 are matrices and h and t help me make a line, none of them looks important in my question to you.
采纳的回答
更多回答(1 个)
Azzi Abdelmalek
2013-6-15
编辑:Azzi Abdelmalek
2013-6-15
couleur='ym'
for k=1:2
plot(ZZ,dTdz3,'.',h,t,couleur(k))
end
1 个评论
Azzi Abdelmalek
2013-6-15
You can also use hold all to obtain different color
类别
在 帮助中心 和 File Exchange 中查找有关 2-D and 3-D Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
