I'm trying to recreate this picture in the tikz environment.
But with the Cumulative Distribution function that I found and altered.
\begin{tikzpicture}[scale=2]
% define normal distribution function 'normaltwo'
\def\normaltwo{\x,{2/exp(((\x-4)^2)/2)}}
% input y parameter
\def\y{5}
% this line calculates f(y)
\def\fy{2/exp(((\y-4)^2)/2)}
% Shade orange area underneath curve.
\fill [fill=orange!60] (2.6,0) -- plot[domain=0:3.5] (\normaltwo) -- ({\y-1.45},0) -- cycle;
% Draw and label normal distribution function
\draw[color=blue,domain=1:7] plot (\normaltwo) node[right] {};
% Add dashed line dropping down from normal.
\draw[-] (2,.05)--(2,-.05) node[below] {\footnotesize ${\mu}-{2}{\sigma}$};
\draw[-] (3,.05)--(3,-.05) node[below] {\footnotesize ${{\mu}-{\sigma}}$};
\draw[-] (3.55,.005)--(3.55,-.05) node[below] {\footnotesize ${x}$};
\draw[-] (4,.05)--(4,-.05) node[below] {\footnotesize ${\mu}$};
\draw[-] (5,.05)--(5,-.05) node[below] {\footnotesize ${\mu}+{\sigma}$};
\draw[-] (6,.05)--(6,-.05) node[below] {\footnotesize ${\mu}+{2}{\sigma}$};
% Optional: Add axis labels
\draw (-.2,2.5) ;
\draw (3,-.5) ;
% Optional: Add axes
\draw[->] (0,0) -- (7.2,0) node[right] {${x}$};
\draw[->] (0,0) -- (0,2.5) node[above] {${y}$};
\draw[-,dashed] (7,-1)--(-.08,-1) node[left] {\footnotesize ${1}$};
\draw[-] (7,-3)--(-.08,-3) node[left] {\footnotesize ${0}$};
\draw[-] (-.08,-3)--(7,-3) node[right] {\footnotesize ${z}$-scale};
\draw[-] (0,-3)--(0,-.9) node[above] {\footnotesize ${\Phi}\gobble{\Phi..}({z}\gobble{\Phi..})$};
\draw[-] (0,-2)--(-.05,-2);
%\draw[-] (1,-2.95)--(1,-3.05) node[below] {\footnotesize $-{3}$};
\draw[-] (2,-2.95)--(2,-3.05) node[below] {\footnotesize ${-2}$};
\draw[-] (3,-2.95)--(3,-3.05) node[below] {\footnotesize ${-1}$};
\draw[-] (4,-2.95)--(4,-3.05) node[below] {\footnotesize ${0}$};
\draw[-] (5,-2.95)--(5,-3.05) node[below] {\footnotesize ${1}$};
\draw[-] (6,-2.95)--(6,-3.05) node[below] {\footnotesize ${2}$};
%\draw[-] (7,-2.95)--(7,-3.05) node[below] {\footnotesize ${3}$};
\draw[-,dashed] (2,-.3)--(2,-3);
\draw[-,dashed] (3,-.3)--(3,-3);
\draw[-,dashed] (4,-.3)--(4,-3);
\draw[-,dashed] (5,-.3)--(5,-3);
\draw[-,dashed] (6,-.3)--(6,-3);
\end{tikzpicture}
Now I just need to draw the function through it. I found some function but they wouldn't line up with my top graph. I tried embedding atan(x-4)/2.6+.53
into the graph but than didn't even work. Help plz
Best Answer
Probably your main problem is that you think that the
atan
function gives the result in radians. But:Use:
and adjust the curve position. Notice the extra braces needed to hide the internal parenthesis to the parser.
Anyway, this kind of diagram would be much easier with
pgfplots
.