Skip to content
Plot templates

Function Family — Normal Densities at Three Widths

Three normal densities sharing a mean and differing in width, written as formulas rather than as sampled points. The engine carries erf and gamma for exactly this reason: a density written out of exp and log by hand is where the arithmetic error usually enters, and a figure of a wrong density is indistinguishable from a figure of a right one.

Template previewPlot
Normal densities3 series (function). x from -6 to 6 — x. y from 0 to 0.8 — Probability density. Series: σ = 0.5; σ = 1; σ = 2.Normal densitiesμ = 0, three standard deviations · 3 series · 405 pointsσ = 0.5σ = 1σ = 2-6-4-20246x00.20.40.60.8Probability densityσ = 0.5σ = 1σ = 2Written as formulas, so the figure and the caption cannot disagree about which density is drawn. The engine parses these; it never evaluates them as code.

Make it your own.

title: Normal densities
subtitle: μ = 0, three standard deviations
x: x
y: Probability density
grid: both
legend: right

plot "σ = 0.5" y = exp(-x^2/(2*0.25))/(0.5*sqrt(2pi)) for x in [-6, 6]
plot "σ = 1" y = exp(-x^2/2)/sqrt(2pi) for x in [-6, 6]
plot "σ = 2" y = exp(-x^2/8)/(2*sqrt(2pi)) for x in [-6, 6]

note: Written as formulas, so the figure and the caption cannot disagree about which density is drawn. The engine parses these; it never evaluates them as code.