Asked
Active
Viewed 120 times
-2
Rebecca
- 177
-
3What do you have tried? – Sebastiano Feb 23 '19 at 21:23
-
2Similar to combining two copies of https://tex.stackexchange.com/questions/330412/how-to-get-this-gaussian-plot and https://tex.stackexchange.com/questions/352933/drawing-a-normal-distribution-graph and https://tex.stackexchange.com/questions/100022/plotting-normal-distribution-in-pgfplots – Feb 23 '19 at 21:29
1 Answers
2
This may serve as a basis of a question that will be appreciated more. I will be happy to remove this.
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{patterns}
\definecolor{lazy}{RGB}{189,208,112}
\begin{document}
\begin{tikzpicture}[declare function={gauss(\x,\y)=exp(-(\x/\y)*(\x/\y));}]
\draw (-5,0) -- (5,0)node[below right]{$\mu$};
\draw (0,0) -- (0,4) node[above]{$f(x)$};
\path[pattern color=lazy,pattern=vertical lines]
plot[variable=\x,domain=-2:3,smooth] ({\x},{3*gauss(\x+2,1.5)}) -| cycle;
\draw[color=lazy] plot[variable=\x,domain=-5:3,smooth] ({\x},{3*gauss(\x+2,1.5)});
\path[pattern color=red,pattern=vertical lines]
plot[variable=\x,domain=-5:-2,smooth] ({\x},{3*gauss(\x,1.5)}) |- cycle;
\draw[color=blue] plot[variable=\x,domain=-5:5,smooth] ({\x},{3*gauss(\x,1.5)});
\end{tikzpicture}
\end{document}

