Message Boards Message Boards

1
|
29981 Views
|
5 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Increase the font size of the PlotLegends?

Hi, I have these command lines, but I would like to increase the font size of the Legend. How i can do?

Needs["PlotLegends`"];
ListLinePlot[cpdiff[[All, All, All]],PlotRange -> All,  Frame->{{True,True},{True,True}},PlotLegend-> rapp, LegendPosition->{1,-0.4},PlotMarkers-> {Automatic,9},ImageSize->1000,
LegendShadow ->None,
 FrameLabel->{{ DCp,DCp },{obstacle perimeter," \[Alpha] = 0\[Degree]"}},
RotateLabel -> False, Axes ->True,AxesStyle->Directive[Black, Thick,Dashed],
FrameStyle->Directive[Black,Thick,Bold, FontSize->20], GridLines ->{{0.5,1,1.5,2,2.5,3,3.5,4},Automatic}, 
GridLinesStyle -> Directive[Gray, Dashed]]

this is the graphic enter image description here

Thanks

Margherita

5 Replies

Have you tried applying the styles to the individual labels?

ListLinePlot[{a, b}, Frame -> True, 
 PlotLabel -> 
  Style["Test", FontFamily -> "Arial", Red, FontSize -> 20], 
 PlotRange -> {{1, 4}, {0, 20}}, 
 PlotLegends -> {Style["a", Blue], Style["b", 25]}, 
 FrameLabel -> {Style["X-axis [n]", Magenta, 18], "Y-axis"}, 
 InterpolationOrder -> 2]
POSTED BY: Gianluca Gorni

Hi, Thanks a lot for your suggestions. I have 10.2 version of Mathematica. I have tried the suggested command

Directive[FontFamily -> "Arial", Red, FontSize -> 20]

without good result.

In fact It is necessary to separate the font size of the frame and the font size of the legend, but how?

What did you try yourself? A simple command like:

a={10,11,15,14};
b={2,5,4,6};

ListLinePlot[{a,b},
    Frame->True,
    PlotLabel->Style["Test"],
    PlotRange->{{1,4},{0,20}},
    PlotLegends->LineLegend[{"a","b"}, LabelStyle->Directive[Blue,18]],
    FrameLabel->{"X-axis [n]","Y-axis"},
    LabelStyle->Directive[FontFamily->"Arial",Red,FontSize->20],
    InterpolationOrder->2
]

might give you what you want? Have a look in the documentation at "guide/Legends" (without quotes).

POSTED BY: Sander Huisman

Hi Margherita,

I hope this will help. Cheers,....Jos (MM Version 10.4.0.0)

a = {10, 11, 15, 14};
b = {2, 5, 4, 6};

ListLinePlot[{a, b}
 , Frame -> True
 , PlotLabel -> Style["Test"]
 , PlotRange -> {{1, 4}, {0, 20}}
 , PlotLegends -> {"a", "b"}
 , FrameLabel -> {"X-axis [n]", "Y-axis"}
 , LabelStyle -> Directive[FontFamily -> "Arial", Red, FontSize -> 20]
 , InterpolationOrder -> 2
 ]

enter image description here

POSTED BY: Jos Klaps

Which version of Mathematica are you using? depending on the version the answer is easy or hard...

POSTED BY: Sander Huisman
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