3
$\begingroup$

I want to provide a Plot with a big and bold PlotLabel as headline for the whole picture. In order to do this, I write e.g. LabelStyle -> Directive[Bold, 20], PlotLabel -> "Fig. 1B"

However, then Bold and the character size is also used for the AxesLabel and even for the numbers at the ticks and I don't like that. It looks too fat for my purpose.

It looks like LabelStyle affects not only PlotLabel, but also AxesLabels and the size of numbers of symbols used for ticks (the latter seem both to be ca 15% smaller, but still I dislike them being fat and I even prefer their size to become smaller. I want to control them separately in my own way.).

How to achieve this?

$\endgroup$
2
$\begingroup$

Do AxesLabel, PlotLabel and do the ticks all use LabelStyle?

Although the documentation suggests the answer is yes

enter image description here

it seems that it is not always the case. For example, FontSize specified in LabelStyle is used in axes and ticks but it is ignored in plot label:

Plot[2 Sin[x], {x, 0, 10}, AxesLabel -> {x, y}, PlotLabel -> 2 Sin[x],
 LabelStyle -> Directive[Red, Large]]

enter image description here

In case you need to apply the same styles to all label-like objects in a single place, you can use BaseStyle with suboptions FontColor, FontSize, FontFamily etc, e.g.

BaseStyle -> Directive[FontColor -> Red, FontSize -> Large]

Can one separate them?

Relevant parts from the Documentation >> TicksStyle:

  • Any outside styles not explicitly overridden by settings in TicksStyle will still be used.

  • TicksStyle can be used together with LabelStyle and has higher priority

  • TicksStyle can be used together with AxesStyle, and has higher priority

And from Documentation >> AxesStyle:

  • AxesStyle gives both the style of the axes themselves, and the default style for labels and ticks. TicksStyle overrides specifications for ticks.

For example:

Plot[2 Sin[x], {x, 0, 10}, AxesLabel -> {x, y}, PlotLabel -> 2 Sin[x],
 BaseStyle -> Directive[FontColor -> Red, FontSize -> 24], 
 AxesStyle -> Directive[Gray, FontSize -> 20], 
 TicksStyle -> Directive[FontColor -> Green, FontSize -> 14]]

enter image description here

$\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.