I have looked through other posts to find out what the default plot color is, but when I use it, the color doesn't seem to match. Can anyone explain why I'm seeing different output?
The reason I ask is that I'd like to provide higher level plotting function that have an optional color parameter. If you don't provide your own color, I'd like to use Mathematica's defaults...but it doesn't create the same output.
BarChart[Range[5]]

BarChart[Range[5], ChartStyle -> ColorData[1, 1]]
![Mathematica BarChart with ColorData[1,1]](../../images/8efce5e4ebf2137bcb4b4aef5724cad5.webp)
Thanks, Bill
Update: Thanks for the help so far. It looks like BarCharts get a different color set than regular plots, because ColorData[1, 1] is the default color for Plot and ListPlot:
Plot[Sin[x], {x, -Pi, Pi}, PlotStyle -> Thickness[0.02]]

But I do like the color set that is the default for BarChart:
BarChart[{Range[5]}]

As I look through the available color pallets, I'm not sure I see those as an option:
Grid[Partition[
Framed[Show[ColorData[#, "Image"], ImageSize -> 100],
FrameStyle -> Gray] & /@ ColorData["Indexed"], 6, 6, 1, {}],
Spacings -> .25]

Some further reflections. It hit me that the colors used for the BarChart are actually some type of gradient. It seems to be a "pastel rainbow" if I can call it that. It goes from blue to red, but it's not the bright rainbow colors, and it seems to lock in the first and last colors while changing the colors of the bars in a smooth fashion according to some function (I will be trying to figure this out). You can see what I'm talking about if you plot the following: BarChart[{Range[40]}, ImageSize -> Large]
I tried matching this to one of the named gradients, but none of them match. That first bluish/purple color is not represented in any of these plots (was looking for Red and Green around 0.8 with a Blue around 1):
Plot[{ColorData[#, x][[1]], ColorData[#, x][[2]],
ColorData[#, x][[3]]}, {x, 0, 1}, PlotStyle -> {Red, Green, Blue},
PlotLabel -> #] & /@ ColorData["Gradients"]








CommunityGraphPlotso that I could create a legend. I think I probably usedTraceto track it down. – Simon Woods Feb 12 '14 at 22:10Trace. If you remember or recreate the discovery please let me know; I'm always happy to improve my skills. – Mr.Wizard Feb 13 '14 at 01:22rogerStylesappears (in v9) in the trace for multi-colour bar charts, e.g.Trace[BarChart[{{1,2,3}}], TraceInternal -> True]but not for single-colour charts (it looks like the light blue is hard coded) – Simon Woods Feb 13 '14 at 10:00"Charting`"come from? Is it a file package or built-in? Who injects this context into the kernel? And who the hell isroger?? – István Zachar Feb 18 '14 at 00:48