How to avoid color repetition in plotting lines

조회 수: 132 (최근 30일)
Abdulazeez Abba
Abdulazeez Abba 2022년 4월 29일
편집: DGM 2022년 4월 29일
I have a plot of about 30 lines and i want every color to be unique in identification, please how can i do this?

채택된 답변

DGM
DGM 2022년 4월 29일
편집: DGM 2022년 4월 29일
The colors used by line plots are drawn from the 'colororder' property of the parent axes. By default, this is set to lines(7), so you'll only have 7 unique colors before it repeats.
You can set the colororder to any valid colormap:
set(gca,'colororder',parula(32))
... though you may find that it's difficult to distinguish between the lines due to the linearity of the colormap.
There are many colormaps available on the File Exchange that may be suitable for your needs, or you might try something like this:

추가 답변 (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