3
$\begingroup$

Is it possible to change the font in LineLegend? In fact, I need a mathematical font (like Times) in this part.

$\endgroup$
7
$\begingroup$

You can use the option LabelStyle with suboptions FontFamily, FontSize, FontColor etc to set font properties:

LineLegend[{Red, Green, Blue}, {"red", "green", "blue"}, 
 LegendLabel -> Style["legend", FontFamily -> "Arial", 32, Black], 
 LabelStyle -> {FontFamily -> "Times New Roman", FontSize -> 24, 
   FontColor -> Purple, FontSlant -> Italic, FontWeight -> "Heavy"}]

enter image description here

For the options FontSize, FontColor, FontSlant, FontWeight, Wolfram language is able to infer the associated option if you provide only the values of these options:

LineLegend[{Red, Green, Blue}, {"red", "green", "blue"}, 
 LegendLabel -> Style["legend", FontFamily -> "Arial", 32, Black], 
 LabelStyle -> {FontFamily -> "Times New Roman", 24, Purple, Italic, Bold}]

same picture

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