12
$\begingroup$

Users of version 9 might be surprised by this outcome:

Plot[{Sin[x], Cos[x]}, {x, 0, 5}, BaseStyle -> AbsoluteThickness[5]]

enter image description here

It seems that BaseStyle->AbsoluteThickness[whatever] doesn't work anymore. How can one fix this?

$\endgroup$
3
  • $\begingroup$ Why don't you used PlotStyle instead of BaseStyle? $\endgroup$ Commented Jul 11, 2014 at 8:52
  • 2
    $\begingroup$ @Algohi - this is relevant if you want to set a thickness as the default, e.g. in a package, and then let users choose colors without having to re-select the desired default thickness. $\endgroup$
    – Verbeia
    Commented Jul 11, 2014 at 9:05
  • $\begingroup$ Interesting effect if you try 100 instead of 5... $\endgroup$ Commented Sep 17, 2014 at 13:57

1 Answer 1

12
$\begingroup$

The issue seems to be that different PlotThemes take precedence over certain settings of BaseStyle. As noted in the new answer to this old question, BaseStyle->AbsoluteDashing[{some list}] works in the default theme because this isn't specified in the theme.

Here is another odd result. If PlotTheme is "Monochrome" (or "Scientific"), the BaseStyle setting for AbsoluteThickness affects the axes but not the lines.

Plot[{Sin[x], Cos[x]}, {x, 0, 5}, BaseStyle -> AbsoluteThickness[5], 
 PlotTheme -> "Monochrome"]

enter image description here

To avoid strange results, set PlotTheme -> None.

Plot[{Sin[x], Cos[x]}, {x, 0, 5}, BaseStyle -> AbsoluteThickness[5], 
 PlotTheme -> None]

enter image description here

Themes that have the same issue as the default theme include "Detailed", "Minimal", "Web", "Business" and "Marketing" and "Classic".

$\endgroup$

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.