# How to make the legend with color more compact in a plot?

I have a plot as below:-

lg1 = {GraphicsRow[{Blue, "- Type A"}], GraphicsRow[{Orange, "- Type B"}]};
plot1 = ListPlot[{{{4, 1}, {3, 6}, {3, 4}}, {{4, 7}, {8, 5}, {2, 6}}}, PlotRange -> All];
Legended[plot1, lg1] As you can see, the legend is very "loose". I want to to be more compact. In fact I can change lg1 to lg1 = Column@{"Blue - Type A", "Orange - Type B"}, but then the color will become text as below:- How can I keep the color and make it more compact? Many thanks!

• Use an option from within ListPlot such as: ListPlot[{{{4, 1}, {3, 6}, {3, 4}}, {{4, 7}, {8, 5}, {2, 6}}}, PlotRange -> All, PlotLegends -> {"Type A", "Type B"}] – bobthechemist Jul 6 '18 at 23:09
• Thanks for reply. But for this case, Legended is needed to be at the outer most layer. In my real case, there is a show between the Legended and the plots (there are several plots), and the legend needs to be dynamic as well. Thus the Legended cannot just be input as a plot option. – H42 Jul 6 '18 at 23:15

GraphicsRow is introducing lots of space. If you're going to construct the legend manually, I suggest using Row instead, which gives a much more compact result:

lg1 = {Row[{Blue, "- Type A"}], Row[{Orange, "- Type B"}]};
plot1 = ListPlot[{{{4, 1}, {3, 6}, {3, 4}}, {{4, 7}, {8, 5}, {2, 6}}},
PlotRange -> All];
Legended[plot1, lg1] Also, the use of Show shouldn't necessarily be an issue for Legended or PlotLegends. The dynamics might not either, but it may depend on what your specific usage is.

Row[{ListPlot[{{{4, 1}, {3, 6}, {3, 4}}, {{4, 7}, {8, 5}, {2, 6}}},
PlotRange -> All],
Grid[{{Blue, "- Type A"}, {Orange, "- Type B"}}]}] 