2
$\begingroup$

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?

$\endgroup$
2
$\begingroup$

We'll start by extracting all the plot themes:

allPlotThemes =
  GroupBy[
   Cases[
    System`PlotThemeDump`resolvePlotTheme // DownValues // Keys,
    HoldPattern[
      System`PlotThemeDump`resolvePlotTheme[___?(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 = Charting`ResolvePlotTheme[Automatic, sym]},
    Charting`ResolvePlotTheme[#, sym] =!= main &
    ]
   ];

And applying that to Plot:

fullThemes[Plot]

{"AGU", "AHA", "AmericanGeophysicalUnion", \
"AmericanHeartAssociation", "AnnualReviews", "AR", "ASPET", \
"BioMedCentral", "BlackBackground", "BlackDefaultAxes", "BMC", \
"BoldLabel", "BoldLabels", "Business", "BusinessPresentation", \
"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", \
"LargeLabelWhite", "LargePadding", "Legend", "LegendPlaceholder", \
"LegendPlaceholders", "Legends", "Marketing", "MarketingColor", \
"MarketingPresentation", "Medium", "Minimal", "MinimalAxes", \
"MinimalAxis", "MinimalComponent", "MobileApp", "Monochrome", \
"NaturePublishingGroup", "NoAxes", "NoPadding", "Notepad", "NPG", \
"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:

themeses

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

$\endgroup$
  • 1
    $\begingroup$ 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) $\endgroup$ – MarcoB Jun 3 '18 at 21:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.