Hello I wanna create a Normal distributed figure. with sigma = 10 and mu =185;
I have the following code based on Bi-variate Normal distribution
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}[
declare function={mu=185;}, %
declare function={sigma=10;}, %
declare function={normal(\m,\s)=1/(2*\s*sqrt(pi))*exp(-(x-\m)^2/(2*\s^2));}] %
\begin{axis}[
width=15cm,
enlargelimits=false,
grid=major,
domain=-1:4,
y domain=-1:4,
samples=201,
xlabel=$x_1$,
ylabel=$P$,
]
\addplot [domain=150:220,samples=201, samples y=0, thick, smooth] (x,4,{normal(mu,sigma)});
\end{axis}
\end{tikzpicture}
\end{document}
The thing is that i get every time the following error.
Paragraph ended before \pgfflt@readlowlevelfloat was complete
\begin{axis} on input line 480 ended by \end{document}. \end{document}
Missing \endgroup inserted \end{document}
What does I wrong? The stupid thing is that when I copy the original it works fine and mine less big version doesn't work…
I hope somebody can help me
Thanks
\addplotinstead of\addplot3suggests)? – Jake Apr 23 '15 at 12:20Both methods have to come to the same result isn't it? What is than the difference??
But still i don't understand why my latex won't run and gives errors... – Jan-Bert Apr 23 '15 at 12:51
\addplot [domain=150:220,samples=201,thick, smooth] {normal(mu,sigma)};– Jake Apr 23 '15 at 12:55(x,4,{normal(mu,sigma)})is 3D coordinate... – Paul Gaborit Apr 23 '15 at 14:16(2*\s*sqrt(pi))for(\s*sqrt(2*pi))– jpayansomet Apr 24 '15 at 08:52another thing. I try to get arrows under my figure like showed in Plotting bell shaped curve in TikZ-PGF.
I can't figure out why
\draw [yshift=-0.6cm, latex-latex](axis cs:-10,0) -- node [fill=white] {$x_1$} (axis cs:-15,0);doesn't work. I don't get any error. But it doesn't show anything eighter… – Jan-Bert Apr 24 '15 at 12:11