I've been using the shiny new legends in V9 for my plots. However, I usually increase the Frame
/Axis
Thickness
and the plot Thickness
and I would like the thickness of the legend line to match. There is a related question (Legend of a plot: how to increase the size of the line/marker?) asked about using the previous PlotLegends
package.
See this simple example, modified from the documentation:
Plot[{Sin[x], Cos[x]}, {x, 0, 2 \[Pi]},
PlotLegends -> Automatic,
PlotStyle -> Thickness[0.005],
AxesStyle -> Thickness[0.005]]
I've tried the obvious modification of the LineLegend
LabelStyle
, however, this just appears to modify the text and has no effect here:
Plot[{Sin[x], Cos[x]}, {x, 0, 2 \[Pi]},
PlotLegends -> LineLegend[Automatic, LabelStyle -> Thickness[0.5]],
PlotStyle -> Thickness[0.005],
AxesStyle -> Thickness[0.005]]
I found that I could set Joined -> False
and use a thicker line
as a LegendMarker
but it is never as long as the normal legend line no matter how long you make the line... (also note that to get a comparable thickness it has to be set two orders of magnitude higher)
Plot[{Sin[x], Cos[x]}, {x, 0, 2 \[Pi]},
PlotLegends ->
LineLegend[Automatic, Joined -> False,
LabelStyle -> Directive[FontFamily -> "Helvetica", Medium],
LegendMarkers ->
Graphics[{Thickness[0.5], Line[{{-2, 0}, {2, 0}}]}]],
PlotStyle -> Thickness[0.005], AxesStyle -> Thickness[0.005]]
now make the line really long (no change):
Plot[{Sin[x], Cos[x]}, {x, 0, 2 \[Pi]},
PlotLegends ->
LineLegend[Automatic, Joined -> False,
LabelStyle -> Directive[FontFamily -> "Helvetica", Medium],
LegendMarkers ->
Graphics[{Thickness[0.5], Line[{{-100, 0}, {100, 0}}]}]],
PlotStyle -> Thickness[0.005], AxesStyle -> Thickness[0.005]]
I've tried to look at the InputForm
for the plots and for just a LineLegend
but I can't figure out what exactly I need to replace to fix this.
"Expressions"
toAutomatic
as it will display the equations used, for function plots, only, of course. $\endgroup$LegendMarkerSize
. See also: mathematica.stackexchange.com/q/19283/8 $\endgroup$