Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Is it possible to set the font family to Arial for axes, legends and labels globally?

I found out about

SetOptions[
  Legending`GridLegend, 
  Legending`LegendContainer -> (Framed@ Append[#, FontFamily -> "Arial"] &)
];

for legends, but now I am trying to set the axis labels.

share|improve this question

2 Answers 2

up vote 8 down vote accepted

In addition to AxesStyle etc. which can be set for specific functions such as Plot with e.g. SetOptions[Plot, ...] there are more global FrontEnd settings by Box type. These are accessible in the Option Inspector:

Mathematica graphics

From here we can set options that apply to multiple plot functions, and in fact all Graphics objects that do not override the defaults. You can see in the screen shot that there are options for a variety of FrontEnd graphics Box types, and categories for "Graphics3D" and "Specific" Box Options as well.

You can also do this by command, e.g.:

SetOptions[$FrontEndSession,
  GraphicsBoxOptions -> {AxesStyle -> Directive[FontFamily -> "Arial"]}
]

Change $FrontEndSession to $FrontEnd to make the style persistent.

share|improve this answer
1  
p.s. see also the documentation for DefaultAxesStyle, and other symbols in Names["Default*Style"]. –  Mr.Wizard Sep 18 '12 at 19:14

Use AxesStyle with Directive

Plot[Sin[x], {x, -Pi, Pi}, AxesStyle -> Directive[Red, 15, FontFamily -> "Arial"]]

To set things globally, use SetOptions

 SetOptions[Plot, 
  AxesStyle -> Directive[Red, FontFamily -> "Arial"], 
  LabelStyle -> Directive[Blue, FontFamily -> "Arial"]];

Plot[Sin[x], {x, -Pi, Pi}, PlotLabel -> "my plot",AxesLabel -> {"x", "y"}]

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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