Guest User

Untitled

a guest
Jun 13th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. pgfmathdeclarefunction{gauss}{3}{%
  2. pgfmathparse{1/(#3*sqrt(2*pi))*exp(-((#1-#2)^2)/(2*#3^2))}
  3. }
  4.  
  5. begin{tikzpicture}
  6. % normal distribution PDF
  7. addplot [thick] {gauss(x,0,1)};
  8. % right vertical line
  9. pgfmathparse{gauss(+1.96,0,1)};
  10. pgfmathsetmacropgftempapgfmathresult;
  11. node[coordinate] (a) at (axis cs:+1.96,pgftempa) {};
  12. draw (axis cs:+1.96,0) -- (a);
  13. % left vertial line
  14. pgfmathparse{gauss(-1.96,0,1)};
  15. pgfmathsetmacropgftempbpgfmathresult;
  16. node[coordinate] (b) at (axis cs:-1.96,pgftempb) {};
  17. draw (axis cs:-1.96,0) -- (b);
  18. end{tikzpicture}
  19.  
  20. newcommand{evaluatefunction}[1]{%
  21. pgfmathparse{#1)};
  22. pgfmathsetmacropgftempapgfmathresult;
  23. }
  24. node[coordinate] (a) at (axis cs:+1.96,evaluatefunction{gauss(1.96,0,1)}) {};
Add Comment
Please, Sign In to add comment