What colormap is used to generate ColorOrder?

조회 수: 68 (최근 30일)
KAE
KAE 2017년 2월 9일
편집: Stephen23 2018년 5월 21일
What colormap is used to generate the default ColorOrder used for successive lines in a plot? (I am asking because I want to automatically generate these default colors, and thought colormap might be a way to do so.) In R2016b, these colors can be listed as,
c = get(0, 'DefaultAxesColorOrder')
c =
0 0.4470 0.7410
0.8500 0.3250 0.0980
0.9290 0.6940 0.1250
0.4940 0.1840 0.5560
0.4660 0.6740 0.1880
0.3010 0.7450 0.9330
0.6350 0.0780 0.1840
which is a dull red, blue, yellow, etc. My first thought was that the rows of c came from the parula colormap, the default for pcolor-style plots, but no rows of c and p match,
K>> p = parula(7)
p =
0.2081 0.1663 0.5292
0.0244 0.4350 0.8755
0.0265 0.6137 0.8135
0.1986 0.7214 0.6310
0.6473 0.7456 0.4188
0.9856 0.7372 0.2537
0.9763 0.9831 0.0538
I think it's some kind of visually balanced colormap ordered so each line's color is distinct from its neighbors. What colormap is it?

채택된 답변

Stephen23
Stephen23 2017년 2월 9일
편집: Stephen23 2018년 5월 21일
None.
Who said that the ColorOrder is based on any other colormap? Certainly not the MATLAB documentation:
No mention of "colormap" on any of those pages, because the ColorOrder is its own set of colors, not based on any of the inbuilt MATLAB colormaps.
Note that the colormap lines is defined such that it "matches the default ColorOrder property of the Axes", and its is based around the command get(0,'defaultAxesColorOrder'), so lines is a colormap that is defined in terms of the ColorOrder (but the ColorOrder is not defined in terms of any colormap).
PS: As you have noticed, the 2014b+ ColorOrder are certainly not based on parula: clearly the maroon and purple colors do not exist in parula. And similarly the pre-2014b ColorOrder is not based on jet, because jet never has any gray or magenta values. This quickly disproves this persons erroneous answer:
PPS: Does anyone have a stackexchange account and would like to comment on that answer as being factually incorrect?
  댓글 수: 4
KAE
KAE 2017년 2월 9일
You know, I could just write a function to return the matrix c from above. [I like the default colors and am seeking to use them for another application.]
Stephen23
Stephen23 2017년 2월 9일
That would work too :)

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

추가 답변 (1개)

Abby Skofield
Abby Skofield 2018년 5월 1일
The lines command returns "the color scheme matches the default ColorOrder property of the Axes." In the default case, the following code
co = lines(7)
returns the 7 colors in the default Axes ColorOrder. The lines function is one of the family of predefined colormap functions .

카테고리

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