# What is the precedence of FrameStyle, FrameTicksStyle, and LabelStyle? How to have a LabelStyle different from FrameStyle

From the documentation:

Plot[2 Sin[x], {x, 0, 10}, Frame -> True, FrameLabel -> {x, y},
PlotLabel -> 2 Sin[x], LabelStyle -> Orange]


But then add a frame style:

Plot[2 Sin[x], {x, 0, 10}, Frame -> True, FrameLabel -> {x, y},
PlotLabel -> 2 Sin[x], FrameStyle -> Green, LabelStyle -> Orange]


To me this is unexpected. I thought FrameStyle controlled the frame style not the frame tick or frame label style (if explicit options had been entered for FrameTicksStyle and LabelStyle).

It is possible to separate the styles of the frame and the frame ticks (via FrameTicksStyle). I'm assuming I am missing something very obvious here but how can a user give separate the styles of the frame and the frame labels?

i.e. How can I create a plot with a blue frame and red frame labels?

(I know I can use Style when entering frame labels but I am seeking an answer in terms of plotting options -- if one exists.)

• @J.M. ...and yet despite stating that both FrameTicksStyle and FrameStyle have a higher priority than LabelStyle, the explicit examples show that LabelStyle has a higher priority than FrameTicksStyle. I therefore wouldn't consider this part of the documentation to be enlightening :) Jun 18, 2012 at 7:52
• How are you defining higher priority? FrameTicksStyle supposed higher priority leaves labels unchanged whereas FrameStyle, also higher priority but it changes labels. If they are defined to have the same priority in relation to labels shouldn't they act the same? Jun 18, 2012 at 7:59
• Not pretty, but you can do something like Plot[2 Sin[x], {x, 0, 10}, Frame -> True, FrameLabel -> {x, y}, PlotLabel -> 2 Sin[x], FrameStyle -> Directive[Green, FontColor -> Orange], FrameTicksStyle -> Directive[FontColor -> Black], LabelStyle -> Orange] to have different styles for the frame labels, frame + ticks, and tick marks. Jun 18, 2012 at 8:49
• @Heike can you put that in an answer? It may not be pretty but is still easier than wrapping Style around all frame labels. Jun 18, 2012 at 8:52
• @MikeHoneychurch I've added my comment as an answer Jun 18, 2012 at 9:35

As I mentioned in a comment, you can do something like this to have different styles for the frame, ticks, tick marks, plot label, and frame labels.

Plot[2 Sin[x], {x, 0, 10}, Frame -> True, FrameLabel -> {x, y},
PlotLabel -> 2 Sin[x],
FrameStyle -> Directive[Green, FontColor -> Orange],
FrameTicksStyle -> Directive[Yellow, FontColor -> Black],
LabelStyle -> Purple]


To style the text you can use other options as well such as FontSize, FontFamily, FontWeight etc., but the various options seem to inherit from each other, so setting for example FontSize -> 20 in LabelStyle will also set the size of the tick labels so you would need to set the FontSize in FrameTicksStyle to compensate.

Also, setting FontSize in LabelStyle doesn't seem influence the size of the PlotLabel. To change this you can use the BaseStyle option.

• +1 I forgot the FontColor option sooo many times Jun 18, 2012 at 13:02

"How can I create a plot with a blue frame and red frame labels?"

You could use BaseStyle instead of FrameStyle, however this also colours the x axis.

Plot[2 Sin[x], {x, 0, 10}, Frame -> True, FrameLabel -> {x, y},
PlotLabel -> 2 Sin[x], BaseStyle -> Blue, LabelStyle -> Red]


• This then raises other issues when you want to set frame thickness and so on. So it doesn't really address the more general separation of label and frame style. Jun 18, 2012 at 11:44