# How to plot a x bar control chart?

Does anyone know how to plot a x bar control chart? With mu=12.5, sigma=.8?

I have searched all over mathematica documentation center but still couldn't figure out how?

-
I think it might help to clarify what you want. Can you give some more details on what you would like to see as your ourput? – cartonn Dec 7 '12 at 3:49
I want to plot multiple parallel horizontal lines. Seems to be pretty simple stuff, but couldn't figure out how. Thanks! – Lei Chen Dec 7 '12 at 5:16
Please include some kind of example. A chart graphic found with e.g. Google is fine, but please note the specific elements you wish to replicate. If all else fails draw a chart and take a picture of it. – Mr.Wizard Dec 7 '12 at 11:31

If you simply wish to produce a chart such as Control chart

controlchart[data_,mu_,sigma_,num_,opts:OptionsPattern[]]:=
ListLinePlot[
data,
GridLines->{None,{mu-num sigma, mu,mu+ num sigma}},
GridLinesStyle->Directive[Red, Dashed],
Evaluate[FilterRules[{opts},Options[ListLinePlot]]]
]


So for your case: controlchart[data, 12.5,8,2], if you want 2 standard deviation control limits. If you want to format the lines individually, then you can write your own code with lines in Epilog.

If, however, you wish the more complex cusum control charts with sepcification of more compex control limits that is more complex.

-