5
$\begingroup$

Is there an easy way to make BoxWhiskerChart show both the outliers and the median line? g1 below shows outliers but not the median line, and g2 shows the median line but not the outliers.

data = RandomReal[NormalDistribution[0, 1], 100]; g1 = BoxWhiskerChart[data, "Outliers"] g2 = BoxWhiskerChart[data] 

That is, can BoxWhiskerChart make a boxplot in the style of BoxWhiskerPlot?

Needs["StatisticalPlots`"] data = RandomVariate[StudentTDistribution[5], 100]; BoxWhiskerPlot[data, BoxOutliers -> Automatic] 

Thanks!

$\endgroup$

1 Answer 1

9
$\begingroup$

If you read the Details & Options section in the documentation for BoxWhiskerChart you will find that there are presets but also the ability to control each element. If you want both outliers and a median marker you could do something like the following.

 BoxWhiskerChart[ RandomVariate[NormalDistribution[0, 1], 10]~ Join~{5}, {{"Outliers", "o"}, {"MedianMarker", Automatic}}] 

enter image description here

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.