Sign up ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Possible Duplicate:
Setting the default font for PlotLegends

Using version 9

The option setting for LabelStyle in plots (I've tried this in Plot[], DateListPlot[], and ListLinePlot[]) doesn't appear to affect PlotLegends[] at least the way I've tried it:

Plot[{Sin[x], Cos[x]}, {x, 0, 10}, 
 LabelStyle -> (FontFamily -> "Helvetica Neue"), 
 PlotLegends -> {"Sin", "Cos"}]

Plot[{Sin[x], Cos[x]}, {x, 0, 10}, 
 LabelStyle -> (FontFamily -> "Helvetica Neue"), 
 PlotLegends -> {"Sin", "Cos", LabelStyle -> (FontFamily -> "Helvetica Neue")}]

Both sets of code give the exact (to an eye) output:

enter image description here

Note the legend font remains in some default (TimesNewRoman) setting, where everything else in the plot properly goes to "Helvetica Neue".

I've also tried wrapping Style[] around each of the legend names to no avail.

Any thoughts on how to do this or work around it?

I stumbled upon a workaround, but it doesn't seem very elegant to me so I remain open to other solutions:

Plot[{Sin[x], Cos[x]}, {x, 0, 10}, 
 LabelStyle -> (FontFamily -> "Helvetica Neue"), 
 PlotLegends -> 
    "Cos"}, {LabelStyle -> (FontFamily -> "Helvetica Neue")}]]

enter image description here

share|improve this question

marked as duplicate by Jens, Mr.Wizard Dec 8 '12 at 10:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

I was about to ask, does it work within LineLegend? I assume from you update it does. – Mr.Wizard Dec 7 '12 at 18:19
@Mr.Wizard -- Yep, works with LineLegend too. Still can't think of a way to do it more directly. – Jagra Dec 7 '12 at 18:37
How about PlotLegends -> (Style[#, FontFamily -> "Helvetica Neue"] & /@ {"Sin", "Cos"})? – Mr.Wizard Dec 7 '12 at 18:44
The syntax description for PlotLegends suggests to me that there are no sub-options. The canonical way to style the legends would be to use one of the four xxLegend legends: The following legend constructors can be used to form commonly occurring legends: SwatchLegend, LineLegend, PointLegend, and BarLegend. – Sjoerd C. de Vries Dec 7 '12 at 18:54
This is a duplicate of – R. M. Dec 8 '12 at 0:55

1 Answer 1

up vote 3 down vote accepted

Since no other answers are forthcoming, I have used a syntax like this in other places:

Plot[{Sin[x], Cos[x]}, {x, 0, 10}, 
 PlotLegends -> (Style[#, FontFamily -> "Helvetica Neue"] & /@ {"Sin", "Cos"})
share|improve this answer

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