Update 2: Post-processing plots
without having to create a new legend:
Legended[Show[plots[[;; , 1]], PlotRange -> All],
Column[Join @@ plots[[;; , 2, All, 1]], Spacings -> -.8]]
Legended[Show[plots[[;; , 1]], PlotRange -> All],
Placed[Column[Join @@ plots[[;; , 2, All, 1]], Spacings -> -.8], {Before, Top}]]
Original post:
Use the (afaik) undocumented option "Spacings"
for LineLegend
:
legend = LineLegend[Hue[#/11] & /@ Range[10], ("Serial " <> ToString[#]) & /@ Range[10],
LabelStyle -> {FontFamily -> "Times", 10},
"Spacings" -> {1, .2}]
or use LegendLayout
with a custom layout function:
legend = LineLegend[Hue[#/11] & /@ Range[10], ("Serial " <> ToString[#]) & /@ Range[10],
LabelStyle -> {FontFamily -> "Times", 10},
LegendLayout -> (Grid[#, Spacings -> {1, .2}] &)]
to get
You can then use legend
with Legended
Legended[Plot[(# x) & /@ Range[10], {x, 0, 1}, Evaluated -> True,
PlotStyle -> (Hue[#/11] & /@ Range[10]), Frame -> True,
FrameLabel -> {"x", "y"}, ImageSize -> 4 72,
BaseStyle -> {FontFamily -> "Times", FontSize -> 10}], legend]
or with PlotLegends
Plot[(# x) & /@ Range[10], {x, 0, 1}, Evaluated -> True,
PlotStyle -> (Hue[#/11] & /@ Range[10]), Frame -> True,
FrameLabel -> {"x", "y"}, ImageSize -> 4 72,
BaseStyle -> {FontFamily -> "Times", FontSize -> 10},
PlotLegends -> legend]
we get
Update: If you do not want to redo the Plot
s you can use your plots
with legend
as follows:
Legended[Show[plots[[;;, 1]], PlotRange -> All], legend]