4

how may I find the name or definitions of colors which are used by default in Plots. I use WM12 ie, if I plot some function it has "blue" colour, next function has "orange" colour. If I need to plot something else corresponding to these curves I would like to use the same colour but I don't know the names of these colours. If I use Blue it is not the same as "blue" used in the plot. Ok, I may choose all colours by me in PlotStyle but do not look for an alternative solution, I'm interested in the default plot colours.

Thank you all, for help.

Michael Seifert
  • 15,208
  • 31
  • 68
Vrbic
  • 75
  • 7
  • 2
    The default colors are from ColorData[97, "ColorList"]. – Rohit Namjoshi May 12 '21 at 12:02
  • Possible duplicates:https://mathematica.stackexchange.com/questions/54629/what-are-the-standard-colors-for-plots-in-mathematica-10, https://mathematica.stackexchange.com/questions/54486/how-to-access-new-colour-schemes-in-version-10. Related: https://mathematica.stackexchange.com/questions/172147/the-default-plotstyle-for-plot3d-and-how-to-replace-the-color – Michael E2 May 12 '21 at 20:18

2 Answers2

6
defaultplotcolors =  Cases[#, _?ColorQ, All] &[
  "DefaultPlotStyle" /. (Method /. Charting`ResolvePlotTheme[Automatic, Plot])]

enter image description here

Alternatively,

defaultColor = "DefaultColor" /. Themes`DefaultStyles[Plot][[All, 2]]
97
ColorData[defaultColor, "ColorList"]

enter image description here

Update: Default colors for various PlotThemes`:

 {#, Cases[#, _?ColorQ, All] &["DefaultPlotStyle" /. 
  (Method /. Charting`ResolvePlotTheme[#, Plot])]} & /@ 
  {Automatic, "Marketing", "Business", "Web", "Scientific"} // 
 Prepend[{"theme", "colors"}] // Grid

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896
2

You can make a plot of n functions and extract from the result the color specifications.

E.g. with 3 functions:

t = Plot[{Sin[x], Cos[x], Tan[x]}, {x, 0, 2 Pi}];

You may look at "FullForm[t]" and note that there are color specifications in the form of "RGBColors[,,_]". You may pick these out by:

Cases[t, RGBColor[__], Infinity] // FullForm

enter image description here

or visual:

Cases[t, RGBColor[__], Infinity]

enter image description here

Daniel Huber
  • 51,463
  • 1
  • 23
  • 57