Color code with dash line
52 次查看(过去 30 天)
显示 更早的评论
Hi,
Could you please tell me the correct code for the dash line with specific color
For colors with dash line such as red and blue, the code can be written as follows:
plot (x,y, 'r:');
my question here is about the above command but for specific color code as stated below:
plot (x,y, 'color',[0 0.5 0]);
Thanks,
0 个评论
采纳的回答
Matz Johansson Bergström
2014-8-24
x=1:10; plot(x, cos(x), ':','color',[0,0.5,0],'linewidth',3)
2 个评论
Matz Johansson Bergström
2014-8-24
I added 'linewidth' because it is difficult to see otherwise. I don't like the dash, I use -- instead, looks nicer when you use a larger linewidth.
Image Analyst
2014-8-24
编辑:Image Analyst
2014-8-24
UTS's "Answer" moved here since it's not an "Answer" to the original post:
Thanks a lot.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!