How to put a title to PlotLegends?
You are probably looking for PointLegend
, but you should provide more details so others can reproduce your results.
mu = {0, 3.3, 6.7, 10, 13, 17, 20};
pl = PointLegend[mu, LegendLabel -> "mu", LegendFunction -> "Frame",
LegendLayout -> "Row", LegendMarkers -> Automatic];
fns = Table[n^(1/p), {p, 7}, {n, 10}];
ListLinePlot[fns, PlotMarkers -> Automatic,
PlotLegends -> Placed[pl, Top]]
You can wrap Placed around the legend. Here's an example modified from the SwatchLegend documentation:
Plot[{Sin[x], Cos[x]}, {x, 0, 5},
PlotLegends -> Placed[SwatchLegend[{"first", "second"},
LegendLabel -> "legend title"], {0.2, 0.3}]]
You can use PlotLegends - > Placed[labels, Top, Labeled[#, legendlabel, Top] &]
.
Using the example input from Tim Laska's answer:
mu = {0, 3.3, 6.7, 10, 13, 17, 20};
fns = Table[n^(1/p), {p, 7}, {n, 10}];
ListLinePlot[fns, PlotMarkers -> Automatic,
PlotLegends -> Placed[mu, Top, Labeled[#, Style["mu", 16], Top] &]]
You can further embellish the appearance using the third argument of Placed
:
ListLinePlot[fns, PlotMarkers -> Automatic,
PlotLegends -> Placed[mu, Top, Panel @ Labeled[#, Style["mu", 16], Top] &]]
ListLinePlot[fns, PlotMarkers -> Automatic,
PlotLegends -> Placed[mu, Top,
Framed[#, FrameStyle -> Directive[Thin, Gray],
RoundingRadius -> 5, ImageMargins -> 5] & @
Labeled[#, Style[Row[{Spacer[5], "mu"}], 24, "Section"], {{Top, Left}}] &]]