daily pastebin goal
78%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)}) {};
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top