What's the default colormap (or color scheme) used in mathematica?
"DefaultColorFunction" /. (Method/. Charting`ResolvePlotTheme[Automatic, ContourPlot])
"M10DefaultDensityGradient"
ColorData["M10DefaultDensityGradient", "ColorFunction"]
ColorDataFunction["M10DefaultDensityGradient", "ThemeGradients",{0,1}, Blend["M10DefaultDensityGradient", #1]&]
ColorData["M10DefaultDensityGradient", "Panel"]
SwatchLegend["M10DefaultDensityGradient", Table["", 15],
LegendMarkerSize -> 50, LegendLayout -> {"Row", 1}]
cp0 = ContourPlot[Sin[x y], {x, 0, 3}, {y, 0, 3}]
cp1 = ContourPlot[Sin[x y], {x, 0, 3}, {y, 0, 3},
ColorFunction -> "M10DefaultDensityGradient"] ;
cp2 = ContourPlot[Sin[x y], {x, 0, 3}, {y, 0, 3},
ColorFunction -> (Blend["M10DefaultDensityGradient", #1]&)];
cp0 === cp1 === cp2
True
Update: To get the blending arguments we can use the function DataPaclets`ColorData`GetBlendArgument
:
DataPaclets`ColorData`GetBlendArgument["M10DefaultDensityGradient"]
The functions Blend[bl, #] &
and ColorData["M10DefaultDensityGradient"]@#
produce the same colors:
And @@ (ColorData["M10DefaultDensityGradient"]@# == Blend[bl, #] & /@
RandomReal[1, 1000])
True
ColorData[97]
is the default color scheme. The answer is found in a few different answers throughout this site. For example, Discussion of PointLegend
and Discussion of DefaultColor. More examples can be found be searching for ColorData[97]
Below is a sample code showing that ColorData[97]
matches the default colors. Note that the color of the points, created with ColorData[97]
, is the same as the color or the lines, created with default colors.
Plot[{Sin[x], Cos[x], Tan[x]}, {x, 0, 1.3}
, Epilog -> {PointSize[0.03],
ColorData[97, 1], Point[{1, Sin[1]}],
ColorData[97, 2], Point[{1, Cos[1]}],
ColorData[97, 3], Point[{1, Tan[1]}]
}]
The following statement will provide the RGBColor values
FullForm@ColorData[97, #] & /@
Range[Length@ColorData[97, "ColorList"]] // TableForm
Below are the results:
kglr's answer identifies the undocumented color function used by Mathematica and is, therefore, the best answer to this question. However, should you find yourself in a situation* where you don't know internals well enough to extract that kind of information, you can always fake the unknown color function with pretty good fidelity. In your case, the following is a good approximation to the actual color function Mathematica uses.
cf[u_] :=
Blend[
{RGBColor[.11, .25, 0.467], RGBColor[.89, .58, .26], RGBColor[1., 0.95, 0.70]},
u]
ContourPlot[Sin[x y], {x, 0, 3}, {y, 0, 3}, ColorFunction -> cf]
The colors used in the blend were picked of the default plot using the dropper tool found on the color picker. Like so
The step-by-step process is
Make a color setter with
ColorSetter[RGBColor[1, 1, 1]]
Click on the color setter to bring up the color picker dialog as shown above.
- Click on the dropper tool at bottom left of the palette. You will get a drag-able magnifier.
- Drag the magnifier over to a area which shows the color you want and click.
- Click on the color picker's OK button. The color setter will now show the selected color.
- Make a copy of the color setter and convert it to input form which will give an
RGBColor
expression for the color.
[*] Which is certainly the situation for me.