Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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!

share|improve this question
add comment

1 Answer

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.