11
$\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$
  • $\begingroup$ Why don't you used PlotStyle instead of BaseStyle? $\endgroup$ – Algohi Jul 11 '14 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 Jul 11 '14 at 9:05
  • $\begingroup$ Interesting effect if you try 100 instead of 5... $\endgroup$ – Sjoerd C. de Vries Sep 17 '14 at 13:57
11
$\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, privacy policy and cookie policy

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