# BoxWhiskerChart - how to show Quartile and other values

I have a question in respect of the BoxWhiskerChart.

The default functionality of BoxWhiskerChart is that you mouse over it and it shows you the tooltips - Max, Quartile III, Median, Quartile I and Min.

Is there a way to extract these data below the chart in a table? Obviously, I think, I could construct my own Grid to do that, but I was wondering whether I could somehow pull the data out of the BoxWhiskerChart since it is included within it anyway.

Or, at least, how to show the value for the "Upper Quartile" and "Lower Quartile" with the help of Labeling function?

SeedRandom[1];
data = RandomVariate[NormalDistribution[], {2, 30}];

bwc = BoxWhiskerChart[data];


You can extract the tooltip labels from bwc using Cases:

tooltips = Cases[bwc, Tooltip[a_, t_] :> t, All]


and use them with Labeled as a label for the chart:

Labeled[bwc, Row[tooltips , Spacer[10]], Bottom]


Alternatively, re-do the chart showing tooltips as ticks using the option ChartLabels:

BoxWhiskerChart[data, ChartLabels -> Placed[tooltips[[All, 1]], Axis]]


• Brilliant, thank you! – Jiri Mar 7 at 10:38
• What do variables "a_" and "t_" relate to in the Tooltip[a_,t_], just for my understanding? – Jiri Mar 7 at 12:07
• @Jiri, Tooltip[expr, label] "displays label as a tooltip while the mouse pointer is in the area where expr is displayed. ". In the rule Tooltip[a_, t_] :> t, a_ is a placeholder for the first argument and t_ is a placeholder for the second argument of an expression of the form Tooltip[...,...], and the rule says, for expressions of that form take the second argument (t). Re patterns like a_, t_ see tutorial/ Introduction to Patterns – kglr Mar 7 at 12:22
• @kgir, again, thank you very much, will read the tutorial! – Jiri Mar 7 at 12:55

You can obtain the quartile values using the Quantile function - linear interpolation (hydrologist method). See the Details section on the Quantile page.

data = Table[RandomVariate[NormalDistribution[\[Mu], 1], 100],
{\[Mu], {0, 3, 2, 5}}];
BoxWhiskerChart[data]
Quantile[data[[1]], {1/4, 3/4}, {{1/2, 0}, {0, 1}}]