Message Boards Message Boards

0
|
9822 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to change the default colour of Frame/AxesLabel in Mathematica10?

Dear All,

I'm trying to make Mathematica 10 generate by default the same plot styles as in Mathematica 9, which can be made, e.g., by

    SetOptions[ListPlot, PlotTheme -> "Classic"]

in an init file or just a notebook.

Now, I'd like to change the default text style of Frame/AxesLabel independently of the PlotTheme. In particular I'd like to obtain the same result as in

ListPlot[data,AxesLabel->(Style[#,Black]&/@{"LabelA","LabelB"})]

as a default label style. Passing anything like that to SetOptions has not worked for me...

Any ideas? Thanks in advance.

POSTED BY: Jeremi Ochab
3 Replies

I was going to suggest using BaseStyle as in

Plot[x, {x, 1, 3}, AxesLabel -> ({"LabelA", "LabelB"}), 
 BaseStyle -> 
  Directive @@ {FontFamily -> "Helvetica", 12, Italic, 
    FontColor -> Red}]

which would also color the text in font used on the ticks. However they could be separately set as in

Plot[x, {x, 1, 3}, AxesLabel -> ({"LabelA", "LabelB"}), 
 BaseStyle -> 
  Directive @@ {FontFamily -> "Helvetica", 16, Italic, 
    FontColor -> Red},
 TicksStyle -> 
  Directive @@ {FontFamily -> "Helvetica", 10, FontColor -> Black}]

However, if you are using Mathematica 10, you will see that the color of the Labels is not Red. This is a bug...and it worked in Mathematica 9. I filed a bug report. It turns out that it is a known bug. Hopefully it will get fixed in a later version of Mathematica.

POSTED BY: David Reiss

Thanks for the reply David,

unfortunately even if it worked as you say it should, I do not see how I can put it into SetOptions or otherwise make it default without having to paste it into every Plot function.

In Mma10 I tried BaseStyle inside Plot and the only things it affected was the text in Insets and PlotLegends. Ticks and Labels remained unchanged. When I tried

SetOptions[Plot,BaseStyle->Directive @@ {FontFamily -> "Helvetica", 16, Italic, 
    FontColor -> Red}]

nothing changed whatsoever.

POSTED BY: Jeremi Ochab

Using

SetOptions[Plot,BaseStyle->Directive @@ {FontFamily -> "Helvetica", 16, Italic, 
    FontColor -> Red}]

works fine for me (except for the FontColor bug, of course).

POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract