9
$\begingroup$

While updating my answer for (189038) I noted that some PlotThemes do not work with Mesh in a meaningful way:

SeedRandom["08.01.2019"];
$plotThemes = Map[ToString] @ { Web, Monochrome, Detailed, Scientific, Business, Marketing, Classic, Minimal };
points = Sort@RandomVariate[UniformDistribution[], 50];
ListAnimate @ Map[
    ListLinePlot[ points, 
       Mesh -> 2, 
       PlotLabel -> #, 
       PlotTheme -> #, 
       ImageSize -> Medium] &,
       $plotThemes
  ]

PlotThemes

There should only be two mesh points shown on the line, but this is not working properly for the following PlotThemes:

  • Monochrome
  • Business
  • Marketing

What can be done about this?

$\endgroup$
  • $\begingroup$ Not really sure, why this question is downvoted—my answer for the linked question has been as well—maybe someone is out to get me? ;-) $\endgroup$ – gwr Jun 3 at 11:48
11
$\begingroup$

Add the option PlotMarkers -> None:

themes = "Base" /. Charting`$PlotThemes;

Grid @ Partition[ListLinePlot[points, Mesh -> 2,
 PlotMarkers->None, PlotLabel -> #, PlotTheme ->#, ImageSize -> Medium]& /@ themes, 2]

enter image description here

We need to add this option for the three themes ("Business", "Marketing" and "Monochrome") because other themes do not use the option PlotMarkers:

Grid[{#, Options[Charting`ResolvePlotTheme[#, ListLinePlot], PlotMarkers] /. 
  HoldPattern[PlotMarkers -> x_List]:> Rule[PlotMarkers,{"..."}]}& /@ themes, 
  Dividers -> All]

enter image description here

| improve this answer | |
$\endgroup$

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.