1
$\begingroup$

I am having a problem with a couple of things in this grouped box chart. Using following data I can plot a grouped box-whisker chart (example):

SeedRandom[1];
labels = {{"first", "second", "third", "fourth", "fifth"}, None};
xdata = RandomReal[10, {5, 5}];
SeedRandom[2];
ydata = RandomReal[10, {5, 5}];
Transpose[{xdata, ydata}];
BoxWhiskerChart[data, ChartLabels -> labels, ImageSize -> 500];

annotated output with requested changes

Here, yellow and blue form one group, and there are 5 groups in total. I would like to

  1. Reduce the ingroup spacing and increase the inter-group spacing.
  2. Rotate the axis label by 45 deg
  3. Remove two extra ticks and put one tick for the group.
  4. Common bottom label (like treatment in the ref fig below)

Something like this with rotated labels: example of desired output

$\endgroup$
2
  • 1
    $\begingroup$ 1. look at the BarSpacing option for BoxWhiskerChart. 2. Look up Rotate. 3. I seem to remember that this has been discussed before here, but I couldn't immediately find it. 4. You may want to create your own legend with SwatchLegend and then maybe enclose the chart and legend in Framed. $\endgroup$
    – MarcoB
    Aug 12, 2022 at 13:25
  • $\begingroup$ Thanks Marco, I was able to do 1, 2 and 4 will be probably easy using frame. $\endgroup$
    – Rupesh
    Aug 12, 2022 at 14:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.