Color code with dash line

조회 수: 39 (최근 30일)
UTS
UTS 2014년 8월 24일
편집: Image Analyst 2014년 8월 24일
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,

채택된 답변

Matz Johansson Bergström
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
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
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 CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by