I wanna plot the density of a normal distribution as it is in the pic below. The Problems:
- the node t=1,63 does not appear in the plot
- do not know how to draw the arrow in an easy way
Here's my code so far:
\documentclass[a4paper,11pt,fleqn]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{ntheorem}
\usepackage{here}
\usepackage{multirow}
\usepackage{eurosym}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows,shadows}
\pagestyle{empty}
\usepackage{graphicx}
\usepackage{array}
\usetikzlibrary{decorations.pathreplacing}
\usepackage{colortbl}
\usepackage[ngerman]{babel}
\usepackage{geometry}
\geometry{a4paper, top=15mm, left=25mm, right=25mm, bottom=20mm,
headsep=10mm, footskip=12mm}
\theoremstyle{break}
\usepackage{amsfonts}
\usepackage{color}
\usepackage{gauss}
\usepackage{pgfplots}
\usepackage{tikz}
\usepackage{gensymb}
\usepackage{systeme}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\pagestyle{empty}
\usepackage{booktabs}
\usetikzlibrary{positioning,fit,calc}
\usetikzlibrary{backgrounds}
\usepackage{amssymb}
\usepackage{amsmath}
\addtokomafont{caption}{\footnotesize}
\setlength{\mathindent}{0pt}
\makeatletter
\g@addto@macro\normalsize{% <----
\setlength\abovedisplayskip{0pt}% <----
\setlength\belowdisplayskip{10pt}% <----
\setlength\abovedisplayshortskip{0pt}% <----
\setlength\belowdisplayshortskip{20pt}% <----
}
\makeatother
\setlength{\intextsep}{0pt}
\tikzset{declare function={
normcdf(\x,\m,\s)=1/(1 + exp(-0.07056*((\x-\m)/\s)^3 - 1.5976* (\x-\m)/\s));
}}
\pgfmathdeclarefunction{gauss{2}{%\pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}%}
\usepackage{tabularx}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} % linksbündig mit Breitenangabe
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} % zentriert mit Breitenangabe
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}} % rechtsbündig mit Breitenangabe
\newcommand*\xbar[1]{%
\hbox{%
\vbox{%
\hrule height 0.5pt % The actual bar
\kern0.5ex% % Distance between bar and symbol
\hbox{%
\kern-0.1em% % Shortening on the left side
\ensuremath{#1}%
\kern-0.1em% % Shortening on the right side}%}%}%}
\usepackage{etoolbox}
\makeatletter
\patchcmd\g@matrix
{\vbox\bgroup}
{\vbox\bgroup\normalbaselines}% restore the standard baselineskip
{}{}
\makeatother
\newcommand{\BAR}{%
\hspace{-\arraycolsep}%
\strut\vrule % the `\vrule` is as high and deep as a strut
\hspace{-\arraycolsep}%
}
\usepackage{tabstackengine}[2016-10-04]
\stackMath
\begin{document}
\begin{figure}[H]
\centering
\begin{tikzpicture}
\begin{axis}[ domain=-1:1,
scale only axis,
axis x line=middle,
axis y line=middle,
inner axis line style={=>},
width=15cm,height=6cm,
ymin=0,ymax=0.45,
xmin=-3.5,xmax=3.5,
axis line style = thick,
xtick={-3,-2,-1,1,2,3},
ytick={0.1,0.2,0.3,0.4},
every axis x label/.style={at={(current axis.right of origin)},anchor=west},
every axis y label/.style={at={(current axis.north)},above=0.5mm},
xlabel={$x$},
ylabel={$f(x)$},
axis on top]
\addplot[fill=blue!25,draw=none,domain=-3.5:-1.63] {gauss(0,1)} \closedcycle;]
\addplot[fill=blue!25,draw=none,domain=1.63:3.5] {gauss(0,1)} \closedcycle;]
\addplot [domain=-3.5:3.5,samples=500,red,thick] {gauss(0,1)};
\node at (axis cs:1.63,-0.05){$t=1.63$};
\end{axis}
\end{tikzpicture}
\caption{Graph der Dichtefunktion $f_X(x)$ mit $X\sim\mathcal{N}(0,1)$}%
\end{figure}
\end{document}



