0
$\begingroup$

The default style selection of ListLinePlot makes it hard to tell things apart, is there some easy way to apply a better (automatically chosen) set of distinct styles? IE, things like varying thickesses, dash style, etc

Here's what I end up with default styles

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ PlotTheme comes to mind. $\endgroup$
    – C. E.
    Commented Apr 10, 2017 at 22:47
  • $\begingroup$ hm, all the plot themes either use colors, or dash/thickness styles, it seems to make 8 series distinct there would need to be a plot theme that uses both $\endgroup$ Commented Apr 11, 2017 at 2:28
  • $\begingroup$ There is a post about creating custom plot themes but the technique used in the answers is undocumented and advanced. $\endgroup$
    – C. E.
    Commented Apr 11, 2017 at 5:13

1 Answer 1

1
$\begingroup$

I found what I needed in mrwizard's answer here -- Specifying non-conflicting PlotTheme options

The trick was to specify another theme just for dashing, and combine it with default Theme:

System`PlotThemeDump`resolvePlotTheme["monoDash", 
  "Plot" | "ListPlot" | "ListLinePlot"] := 
 Themes`SetWeight[{"DefaultDashing" -> {AbsoluteDashing[{}], 
     AbsoluteDashing[{}], AbsoluteDashing[{}], 
     AbsoluteDashing[{5, 5}], AbsoluteDashing[{5, 5}], 
     AbsoluteDashing[{5, 5}], AbsoluteDashing[{}], 
     AbsoluteDashing[{}]}}, System`PlotThemeDump`$ComponentWeight]
System`PlotThemeDump`resolvePlotTheme["monoThick", 
   "Plot" | "ListPlot" | "ListLinePlot"] :=

  Themes`SetWeight[{"DefaultThickness" -> {AbsoluteThickness[3.0], 
      AbsoluteThickness[3.0], AbsoluteThickness[3.0], 
      AbsoluteThickness[1.6], AbsoluteThickness[1.6], 
      AbsoluteThickness[1.6], AbsoluteThickness[1.6], 
      AbsoluteThickness[1.6], AbsoluteThickness[1.6]}}, 
   System`PlotThemeDump`$ComponentWeight];    


seqLen = 100;
nSeq = 9;
seq := Accumulate[
   Table[RandomVariate[NormalDistribution[]], {seqLen}]];
seqs = Table[seq, {nSeq}];
ListLinePlot[seqs, PlotLegends -> {1, 2, 3, 4, 5, 6, 7, 8, 9}, 
 PlotTheme -> {"monoDash", "monoThick"}]

enter image description here

$\endgroup$
1
  • $\begingroup$ What does SetWeight function from Themes` context does? Is there some reference where one can read more about it? $\endgroup$
    – ercegovac
    Commented Sep 26, 2017 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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