How to avoid color repetition in plotting lines
조회 수: 132 (최근 30일)
이전 댓글 표시
I have a plot of about 30 lines and i want every color to be unique in identification, please how can i do this?
댓글 수: 0
채택된 답변
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Colormaps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!