2
$\begingroup$

I want to plot the following Gaussian function

enter image description here

Is there a way that I can do this symbolically without giving values to the constants.

$\endgroup$
2
  • $\begingroup$ Short answer is no, but you could do e.g. a contour plot with x on the x axis and b on the y axis? $\endgroup$
    – chris
    Commented Oct 14, 2020 at 10:29
  • 3
    $\begingroup$ Well, you could put $\hat{f} = f/a$ and $\hat{x} = (x - b)/c$, giving the "universal" curve $\hat{f} = \exp(-\hat{x}^2 / 2)$. The three constants just change the vertical scale, the horizontal offset, and the horizontal scale of the curve. $\endgroup$
    – yawnoc
    Commented Oct 14, 2020 at 13:06

1 Answer 1

3
$\begingroup$

How about this?

f[x_, a_, b_, c_] = a PDF[NormalDistribution[b, c], x]

enter image description here

Then

ContourPlot3D[f[x, 1, b, c], {x, -3, 3}, {b, -1, 1}, {c, 1, 2}]

enter image description here

Note that I am not claiming it is particularly informative!

This might be more useful?

Plot[Table[f[x, 1, b, 1], {b, -1, 1, 1/4}] // Evaluate, {x, -2, 2}, 
 PlotStyle -> ColorData[10]]

enter image description here

Plot[Table[f[x, 1, 1/2, c], {c, 1/2, 2, 1/4}] // Evaluate, {x, -2, 2}, 
 PlotStyle -> ColorData[10]]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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