필터 지우기
필터 지우기

How can i change colors of data in a 2D plot?

조회 수: 4 (최근 30일)
Umair  Ahmed
Umair Ahmed 2020년 3월 19일
댓글: Ameer Hamza 2020년 3월 19일
hi, i am making a 2D plot and have multiple data which i want to be different colors. i used colormaps (lines, parula, prism).. but proble with them is after 3-4 data points the same color gets repeated again and again, and i not able to distinguish between data? can anyone help?
Thanks
  댓글 수: 1
Ameer Hamza
Ameer Hamza 2020년 3월 19일
The colors of lines made using plot() function is decided by the ColorOrder property of axes not Colormap.

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

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 3월 19일
편집: Ameer Hamza 2020년 3월 19일
One way is to increase the colors in the ColorOrder property of the axes. For example, try
rng(0);
ax = axes();
ax.ColorOrder = rand(100, 3);
hold(ax);
%% now run the plot commands.
  댓글 수: 4
Umair  Ahmed
Umair Ahmed 2020년 3월 19일
great, thank you very much!
Ameer Hamza
Ameer Hamza 2020년 3월 19일
Glad to be of help.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by