I am trying to produce the following figure with tikz
.
with the following MWE:
\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
\begin{document}
\pgfmathdeclarefunction{gauss}{3}{%
\pgfmathparse{1/(#3*sqrt(2*pi))*exp(-((#1-#2)^2)/(2*#3^2))}%
}
\begin{tikzpicture}
\begin{axis}[
no markers
, domain=-7.5:25.5
, samples=100
, ymin=0
, axis lines*=left
, xlabel=
, every axis y label/.style={at=(current axis.above origin),anchor=south}
, every axis x label/.style={at=(current axis.right of origin),anchor=west}
, height=5cm
, width=20cm
, xtick=\empty
, ytick=\empty
, enlargelimits=false
, clip=false
, axis on top
, grid = major
, hide y axis
, hide x axis
]
\draw[thick, ->] (axis cs: 0, 0) -- (axis cs: 8, 0) node[anchor = north west] {};
\draw[thick, ->] (axis cs: 0, 0) -- (axis cs: 0, 2) node[anchor = south east] {y};
% Normal Distribution 1
\addplot[blue, ultra thick,restrict x to domain=1:5] {gauss(x, 3, 1)};
\pgfmathsetmacro\valueA{gauss(0, 3, 1)}
\draw [dashed, thick, blue] (axis cs:0, 0) -- (axis cs:0, \valueA);
\node[below] at (axis cs:0, -0.02) {\Large \textcolor{blue}{$Z$}};
\draw[thick, blue] (axis cs:-0.0, -0.01) -- (axis cs:0.0, 0.01);
% Normal Distribution 2
\addplot[rotate=90, green, ultra thick,restrict x to domain=-2:6] {gauss(x, 2, 1)};
% Normal Distribution 3
\addplot[rotate=90, red, ultra thick,restrict x to domain=0:8] {gauss(x, 4, 1)};
\end{axis}
\end{tikzpicture}
\end{document}
Any help to get the required graph will be highly appreciated. Thanks in advance.
controls
...:D
. Thogh I think you'd be better of with using justtikz
than usingpgfplots
because you'll need to tweak a lot with the plot. It would be nice if you could also specify what are you having trouble doing, I'm sure there are several questions here that can already help you go further with your drawing.