# Modified BoxWhiskerChart for statistical summary of data

I would like to make a statistical graph (chart) from data in the format {x-value, mean value, standard deviation} as in:

{{10, 10.73, 0.72}, {20, 14.10, 0.49}, {30, 13.96, 0.49}, {40, 13.43, 0.51}}

I would like the graph to resemble a BoxWhiskerChart, where at each x value the mean is plotted and thin bars extending above and below the mean by a distance equal to the standard deviation. However, BoxWhiskerChart requires the data at each x value to be an entire data set (of multiple points), not the statistical summary. I have merely the mean and standard deviation.

I can kludge drawing lines by computing ranges and such, as follows:

Show[ListPlot[data[[All, {1, 2}]],
Joined -> True,
PlotRange -> {0, Automatic}],
Epilog ->
Table[{Red,
Line[{{data[[i, 1]], data[[i, 2]] - data[[i, 3]]}, {data[[i, 1]],
data[[i, 2]] + data[[i, 3]]}}]}, {i, Length[data]}]]


However, because I have lots of data, and ultimately wish to place several such plots on a single graph (of different colors), I was hoping there was a way to modify BoxWhiskerChart (or related chart) so I can exploit the internal functions and styling.

list = {{10, 10.73, 0.72}, {20, 14.10, 0.49}, {30, 13.96, 0.49}, {40, 13.43, 0.51}};

ListLinePlot[ {#1, Around[#2, #3]} & @@@ list ]


For previous versions (Around is new in 12.0):

Needs["ErrorBarPlots"]
Show[ErrorListPlot[list], PlotRange -> All]


ErrorListPlot takes the option Joined -> True, just like ListPlot, if you want the connecting lines as well. The weird Show[.., PlotRange -> All]` is there to avoid clipping of the error bars.

• Wow... I had never seen that function. Thanks so much! ($\checkmark$) – David G. Stork May 24 '20 at 18:56
• @DavidG.Stork I think it's new in 12.0. Pretty handy, finally there is a simple a way of generating plots with proper error bar in MMA :-) – MarcoB May 24 '20 at 18:57
• Ugh... I "accepted" too soon. I am running v. 11.3 and it doesn't work. Any suggestion for v. 11.3? – David G. Stork May 24 '20 at 18:59
• @DavidG.Stork Yep, see edit. – MarcoB May 24 '20 at 19:03
• Got it. Works. Thanks so much. (Previous acceptance now fully justified!) – David G. Stork May 24 '20 at 19:07