Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pgfmathdeclarefunction{gauss}{3}{%
- pgfmathparse{1/(#3*sqrt(2*pi))*exp(-((#1-#2)^2)/(2*#3^2))}
- }
- begin{tikzpicture}
- % normal distribution PDF
- addplot [thick] {gauss(x,0,1)};
- % right vertical line
- pgfmathparse{gauss(+1.96,0,1)};
- pgfmathsetmacropgftempapgfmathresult;
- node[coordinate] (a) at (axis cs:+1.96,pgftempa) {};
- draw (axis cs:+1.96,0) -- (a);
- % left vertial line
- pgfmathparse{gauss(-1.96,0,1)};
- pgfmathsetmacropgftempbpgfmathresult;
- node[coordinate] (b) at (axis cs:-1.96,pgftempb) {};
- draw (axis cs:-1.96,0) -- (b);
- end{tikzpicture}
- newcommand{evaluatefunction}[1]{%
- pgfmathparse{#1)};
- pgfmathsetmacropgftempapgfmathresult;
- }
- node[coordinate] (a) at (axis cs:+1.96,evaluatefunction{gauss(1.96,0,1)}) {};
Add Comment
Please, Sign In to add comment