Getting gray colored lines in a line plot

Hi,
so I have this plot and there are several lines that I need to plot and I would like some of them to be black, some colored (I know how to do that) and some gray. So how do I get the gray color? And, also, how do I control it? I would like some of the gray lines to be darker and some lighter.
Thank You in advance!

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2012년 8월 25일
편집: Azzi Abdelmalek 2012년 8월 25일

10 개 추천

plot(t,y,'color',[0,0,0 ]) % Black
plot(t,y,'color',[0,0,0]+alpha) % for alpha= 0 to 1 the lines will be more clear
% example
t=0:0.1:10;y=sin(t)
for k=1:20
plot(t,y,'linewidth',8,'Color',[0 0 0]+0.05*k);pause(0.5);
end

댓글 수: 4

Marenostre
Marenostre 2017년 4월 22일
great!!
Muhammad Zayed
Muhammad Zayed 2020년 8월 25일
That's exactly what I am looking for! Thanks a lot!
Jonathan Arias
Jonathan Arias 2020년 12월 8일
beautiful! it works!
Juan Agullo
Juan Agullo 2021년 3월 23일
Thanks! works really well

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Line Plots에 대해 자세히 알아보기

질문:

2012년 8월 25일

댓글:

2021년 3월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by