Im trying to make a legend with data labelled in groups. I'm doing this by combining SwatchLegends
using Row
, Column
and Grid
. Here is an example of a Row
constructed legend:
Framed[
Row[
{
SwatchLegend[
{Red, Green, Blue},
{"label1", "label2", "label3"},
LegendLabel -> "group1",
LegendFunction -> "Frame"
],
SwatchLegend[
{Yellow, Purple},
{"label4", "label5"},
LegendLabel -> "group2",
LegendFunction -> "Frame"
],
SwatchLegend[{Orange},
{"label6"},
LegendLabel -> "group3",
LegendFunction -> "Frame"
]
},
Alignment -> Top]
]
As you can see the option Alignment -> Top
does not cause the legend objects to align at the top as I would expect. Interestingly, if I use Grid
it works pretty much how I expect (with some extra spacing between the Grid
elements):
Framed[
Grid[
{{SwatchLegend[{Red, Green, Blue},
{"label1", "label2", "label3"},
LegendLabel -> "group1",
LegendFunction -> "Frame"],
SwatchLegend[{Yellow, Purple},
{"label4", "label5"},
LegendLabel -> "group2",
LegendFunction -> "Frame"],
SwatchLegend[{Orange},
{"label6"},
LegendLabel -> "group3",
LegendFunction -> "Frame"]}},
Alignment -> Top]]
Is this a bug? Am I using a wrong setting when using Row
?