| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- \documentclass[varwidth=true, border=5pt]{article}
- \usepackage[active,tightpage]{preview}
- \usepackage[latin1]{inputenc}
- \usepackage{amsmath}
- \usepackage{pgfplots}
- \usepackage{tikz}
- \usetikzlibrary{arrows,positioning}
- \usepackage{helvet}
- \usepackage[eulergreek]{sansmath}
- \pgfmathdeclarefunction{gauss}{2}{%
- \pgfmathparse{1/(sqrt(2*pi*#2))*exp(-((x-#1)^2)/(2*#2))}%
- }
- % to be used: \gauss(x)(mean)(variance)
- \pgfplotsset{
- tick label style = {font=\sansmath\sffamily},
- every axis label/.append style={font=\sffamily\footnotesize},
- }
- \begin{document}
- \begin{preview}
- \tikzstyle{plotA}=[ultra thick,red!90!black]
- \tikzstyle{plotB}=[ultra thick,cyan!50!black]
- \begin{tikzpicture}
- \begin{axis}[
- width=13.5cm,
- height=8.625cm,
- % Grid
- grid = major,
- %grid style={thin, dashed},
- % size
- xmin= 0, % start the diagram at this x-coordinate
- xmax= 125, % end the diagram at this x-coordinate
- ymin= 0, % start the diagram at this y-coordinate
- ymax= 0.045, % end the diagram at this y-coordinate
- % Legende
- legend style={
- font=\large\sansmath\sffamily,
- at={(0.5,-0.18)},
- anchor=north,
- legend cell align=left,
- legend columns=-1,
- column sep=0.5cm
- },
- % Ticks
- tick align=inside,
- %minor tick num=3,
- minor tick style={thick},
- scaled y ticks = false,
- % xtick={40,70,80},
- ytick=\empty,
- % Axis
- axis lines = middle,
- axis line style = very thick,
- xlabel=$x$,
- x label style={at={(axis description cs:0.52,0)},
- anchor=north,
- font=\boldmath\Large},
- ylabel=$f(x)$,
- y label style={at={(axis description cs:0,0.5)},
- anchor=south,
- rotate=90,
- font=\boldmath\Large},
- ]
- % Plots of the distributions
- \addplot [domain=0:120,samples=200,plotA] {gauss(60,800)};
- \addplot [domain=0:120,samples=200,plotB] {gauss(40,100)};
- % Add labels
- \node[plotA,above] at (axis cs:102,0.01){\Large $\mathcal{N}(60, 800)$};
- \node[plotB,above] at (axis cs:20,0.03){\Large $\mathcal{N}(40, 100)$};
- % \addlegendentry{$\mu=80,\enskip \sigma^2 = 100$}
- % \addlegendentry{$\mu=40,\enskip \sigma^2 = 100$}
- \end{axis}
- \end{tikzpicture}
- \end{preview}
- \end{document}
|