Normal density plot shading between specifications
plots the standard normal density, shading the portion inside the specification
limits given by the two-element vector
p = normspec(
specs, and returns the
p of the shaded area. If
no lower limit, then set
spec has no upper limit, then set
Create Standard Normal Density Plot Shading Inside of Limits
Create a standard normal density plot, shading the portion inside the specification limits
p = normspec([-1,1])
p = 0.6827
Create Normal Density Plot Shading Outside of Limits
Create a normal density plot, shading the portion outside the specification limits.
For example, consider a production process that fills cans of paint. The average amount of paint in any can is 1 gallon, but variability in the process produces a standard deviation of 2 ounces (2/128 gallons). Create a normal density plot, shading the portion corresponding to the probability that the cans will be filled under specification by 3 or more ounces.
p = normspec([1-3/128,Inf],1,2/128,'outside')
p = 0.0668
specs — Specification limits
two-element numeric vector
Specification limits, specified as a two-element numeric vector. Set
–Inf if there is no
lower limit; set
there is no upper limit.
mu — Mean
0 (default) | scalar value
Mean of the normal distribution, specified as a scalar value.
sigma — Standard deviation
1 (default) | positive scalar value
Standard deviation of the normal distribution, specified as a positive scalar value.
region — Shading region
'inside' (default) |
Shading region, specified as either
'outside'. The function
normspec shades the region either
p — Probability of shaded area
nonnegative scalar value
Probability of the shaded area, returned as a nonnegative scalar value.
h — One or more chart line objects
scalar | vector
One or more chart line objects, returned as a scalar or vector. These objects are unique identifiers that you use to query and modify properties of a specific chart line. For a list of properties, see Line Properties.