# How can I find all the plot themes for a given function?

Plot themes are useful little things that ease the pain of manually styling Mathematica graphics. I have a few favorites, "Web", "Scientific", etc. but when I'm trying our new graphics styling sometimes I want to play with various ones.

So how can I find all the plot themes for, say, Plot?

We'll start by extracting all the plot themes:

allPlotThemes =
GroupBy[
Cases[
SystemPlotThemeDumpresolvePlotTheme // DownValues // Keys,
HoldPattern[
SystemPlotThemeDumpresolvePlotTheme[___?(Not@*StringQ),
things__String, ___?(Not@*StringQ)]
] :>
With[{ll = {things}},
If[Length@ll == 2,
Rule @@ Reverse[ll],
All -> ll[[1]]
]
],
Infinity
],
First -> Last,
Sort@*DeleteDuplicates
];


Then we'll write a function that'll find the distinct styles for a function:

fullThemes[sym_] :=
Select[
Sort@DeleteDuplicates@Flatten@Values@allPlotThemes,
With[{main = ChartingResolvePlotTheme[Automatic, sym]},
ChartingResolvePlotTheme[#, sym] =!= main &
]
];


And applying that to Plot:

fullThemes[Plot]

{"AGU", "AHA", "AmericanGeophysicalUnion", \
"AmericanHeartAssociation", "AnnualReviews", "AR", "ASPET", \
"BioMedCentral", "BlackBackground", "BlackDefaultAxes", "BMC", \
"CellPress", "Classic", "ClassicColor", "ClassicColors", \
"ClassicComponent", "Coarse", "ColorStyle", "Correspondence", "CP", \
"Dashboard", "DashedLines", "Detailed", "DoubleAxis", "Elsevier", \
"Fine", "Frame", "FrameAxes", "FrameAxis", "FrameGrid", "Full", \
"FullAxes", "FullAxesGrid", "Grid", "Grids", "HeavyLines", \
"HeightGrid", "HeightGridBlack", "Icon", "IEEE", \
"IEEEComputerSociety", "IEEECS", "Inline", \
"InstituteOfElectricalAndElectronicsEngineers", "InterResearch", \
"IR", "ItalicLabel", "ItalicLabels", "JournalArticle", "LabelStyle", \
"Large", "LargeLabel", "LargeLabels", "LargeLabelsWhite", \
"LegendPlaceholders", "Legends", "Marketing", "MarketingColor", \
"MarketingPresentation", "Medium", "Minimal", "MinimalAxes", \
"MinimalAxis", "MinimalComponent", "MobileApp", "Monochrome", \
"PLoS", "PLoS3", "Poster", "Presentation", "PublicLibraryOfScience", \
"PublicLibraryOfScienceThreeColumnLayout", "Sans", "SB", \
"Scientific", "ScientificJournal", "Serif", "SimpleEndTicks", \
"SimpleGrid", "SimpleTicks", "SingleAxis", "SizeScale", "SJ", \
"Small", "SmallLabel", "SmallLabels", "SolidGrid", "SolidGridDark", \
"SolidGridDarkBlack", "Sparkline", "SpringerBooks", \
"SpringerJournals", "Square", "StylesheetStyle", "Tall", \
"TaylorFrancis", "TechnicalPresentation", "Test", "TF", "ThickLine", \
"ThickLines", "ThinLine", "ThinLines", "Thumbnail", "Tiny", \
"TrueScale", "Version9", "Web", "WebDetailed", "WhiteDefaultAxes", \
"Wide", "WolframAlpha", "WSM", "WSMBlack", "WSMBlackDark", \
"WSMBlackFill", "WSMBlackFillStripe", "WSMBlackStripe", "WSMDark", \
"WSMFill", "WSMFillStripe", "WSMPastel", "WSMPastelDark", \
"WSMPastelFill", "WSMPastelFillStripe", "WSMPastelStripe", \
"WSMStripe", "WSMVibrant", "WSMVibrantDark", "WSMVibrantFill", \
"WSMVibrantFillStripe", "WSMVibrantStripe"}


And we see lots of fun stuff. Some publisher specific styles, something for a "MobileApp", should WL ever be a truly viable framework for that. And then all sorts of "WSM" styles (which I assume are for Wolfram System Modeler).

Trying some of these on at random:

It looks like most are pretty minor variants, but the WSM styles are all pretty cool, actually.

• A caveat for other users: I just tried this (great!) function (fullThemes[Plot]) in a fresh kernel, and the first execution returned an empty list. This is probably because some internals had not yet been loaded. Further evaluations worked as expected. Thanks @b3m2a1! (+1) Commented Jun 3, 2018 at 21:30