First, create two BoxWhiskerChart
: box1
and box2
data = { {{1, 2, 5}, {7, 2}}, {{5, 7, 2, 2, 5}, {7, 2, 5}} }
style = Sequence[{
{"Whiskers", Dashed},
{"Outliers", None},
{"MedianMarker", 1, Directive[White]}},
ChartStyle -> 56,
ImageSize -> Medium,
ChartLabels -> {{"A", "B", "C"}, None}];
box1 = BoxWhiskerChart[data, style]
box2 = BoxWhiskerChart[data, style]
Then put them together using GraphicsGrid
and add ChartLegends
for them using Legended
:
boxes = Legended[
GraphicsGrid[{{Graphics[box1], Graphics[box2]}}],
ChartLegends -> Placed[{"x", "y"}, "Row"] ]
However, it does not produce the legends:
How to share
ChartLegends
among multipleBoxWhiskerChart
s inGraphicsGrid
?
Related post:
I have encountered a similar problem How to share LineLegend
among sub-figures in GraphicsGrid
?. However, the answer there does not work here.