If I add a legend using
Legended[..., SwatchLegend[..., ...]]
then I can explicitly set the legend marker size using the LegendMarkerSize
option. But I also need to explicitly set the style/colour of the legend elements a second time within the legend expression.
It is usually much more convenient to use the PlotLegens
or the ChartLegends
option. It spares me the trouble of having to manually match up the legens with the plot or chart. If I use this, can I still control the marker size?
Example:
cm = 72/2.54;
BarChart[{{1, 2, 3}, {1, 3, 2}}, ChartLegends -> {"a", "b", "c"}, ImageSize -> 4 cm]
How can I control the legend marker size in the above graphic? Is there anything simpler than an explicit legend specification as below?
colours = {Red, Blue, Black};
Legended[
BarChart[{{1, 2, 3}, {1, 3, 2}}, ImageSize -> 4 cm, ChartStyle -> colours],
SwatchLegend[colours, {"a", "b", "c"}, LegendMarkerSize -> 7]
]