# default color scheme in Histogram in version 10 [duplicate]

I need to use the default scheme of Histogram in version 10 but cannot get this information. I know the default scheme used in Plot-like functions is ColorData[97], but it seems Histogram uses a different one. I tried Options which didn't help too much.

Can someone offer a hint?

• Thanks! This helped me out: mathematica.stackexchange.com/a/66982/260, but in which the extraction key should be changed to ChartDefaultStyle. – sunt05 Aug 12 '16 at 11:07
• @sunt05 - you should post the answer here so it doesn't stay open as an unanswered question. – Jason B. Aug 12 '16 at 13:51
• @JasonB, done. But I cannot find the code/name of this colour scheme, which seems to be a unique one and not an embedded entry in the ColorData collection. – sunt05 Aug 12 '16 at 14:07
• @Michael I favor closing this as a duplicate of (54486). Also related: (54545), (54629), (66923), (103829) – Mr.Wizard Aug 13 '16 at 21:31
• @Mr.Wizard Yes, ChartingResolvePlotTheme[ChartStyle, Histogram] adapted slightly from your PieChart example leads to a solution here. – Michael E2 Aug 14 '16 at 11:44

## 1 Answer

Thanks to the method here, with a minor modification for charts, we can get the answer as follows:

ClearAll[chartColors];
chartColors::usage="plotColors[plotType,plotTheme] gives a list of the colors used in a plot when several curves are drawn. Here plotType is, for example, Plot or ListLogPlot while plotTheme may be \"Scientific\", \"Classic\" etc.";

chartColors[chartType_,plotTheme_]:=("ChartDefaultStyle"/.(Method/.ChartingResolvePlotTheme[plotTheme,chartType]))/.Directive[x_,__]:>x


The output is:

I then tried to look for the name/code of this scheme (something like ColorData[97]) but didn't get anything.

update: As @JasonB pointed out, the only difference between ColorData[97] and the default colour scheme of Histogram is the yellow colours and their sequence:

cl1=chartColors[Histogram,\$PlotTheme];
cl2=ColorData[97,"ColorList"];
Complement[#,Intersection[cl1,cl2]]&/@{cl1,cl2}


The output is:

I cannot understand why WR would break the consistency in default colour schemes of plots/charts functions, in particular the change in colour sequence.

• Look at the output of Thread[{chartColors[Histogram, "Default"] , ColorData[97] /@ Join[{2, 1}, Range[3, 15]]}], it looks like they just switch the first two colors, but it isn't quite true. That yellow color for the histogram is slightly different than the default second plotting color. – Jason B. Aug 12 '16 at 14:19
• Yes, @JasonB, the change in colour is minimal. And I don't understand why WR would change the sequence. – sunt05 Aug 12 '16 at 16:10
• Merely a guess, but perhaps this scheme was hard-coded before ColorData[97] was defined? Or perhaps someone in charge of Histogram thought that 97 needed adjustment and slipped this in? – Mr.Wizard Aug 13 '16 at 21:34
• I am afraid I cannot help you see Mathematica as more beautiful, but you can modify the Histogram colors if you like, to use ColorData[97] instead. Would you like help with that? – Mr.Wizard Aug 14 '16 at 16:05
• Just a note, the second example in the documentation under Histogram (multiple data sets) does not match the output in v12.1, as these colors are NOT reversed. – Chris K Oct 27 '20 at 21:31