Message Boards Message Boards

2 Replies
1 Total Likes
View groups...
Share this post:

Default Chart Color Schemes

Posted 10 years ago
I wish to use the same color scheme as in the default pie chart to generate some companion graphics. For example, the colors in PieChart[Range[10]]. However, I can't find that exact color scheme the charts use listed anywhere in the documentation.  Anyone know if it is accessible? 
POSTED BY: John Meeker
2 Replies
The color scheme appears to be

ColorFunction -> Function[{angle}, ColorConvert[Hue[0.6 - 0.6 angle, 0.34, 1], "RGB"]]]

or more simply,

ColorFunction -> Function[{angle}, Hue[0.6 - 0.6 angle, 0.34, 1]]]

Seems to work on Range for n = 10, 15, 20, ....
POSTED BY: Michael Rogers
You may extract the exact colors that PieChart is using so you will not need to look for the specific color scheme it is using
Say you generate a Pie chart of 10 elements
The colors used by PieChart can be extracted (you need to drop the first two, so I use Drop...]
Now you can use the same colors as the PieChart inside Plot or any other graphics you would like

Plot[Evaluate[Table[n t, {n, 10}]], {t, 0, 1}, PlotStyle -> colors]
Although the above is a "quick" solution, it is also a "dirty" one, since it relies on the internals of PieChart. I would consider to use the same color scheme just by dictating both PieChart and Plot to use it (see the option for ColorFunction for both).

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract