# Could someone help me pgfplots the following functions (w/labels)?

This is an extension of my previous question concerning graphing a pair of functions using pgfplots (please see link below):

Could somebody figure out how to create the following graph using pgfplot?

I am trying to use the code from the previous solution I was given to produce the following functions (with labels etc./no shading) below:

However, I have been running into trouble, and getting something else. So far, this is what I have come up with in terms of code:

\begin{tikzpicture}[
every pin edge/.style={<-},
every pin/.style={fill=yellow!50,rectangle,rounded corners=3pt,font=\small}]
\begin{axis}[every axis plot post/.append style={
mark=none,domain=-5:5,samples=50,smooth},
clip=false,
axis lines=none
]
\node[pin=70:{Most efficient: p(v) has lease MSE}] at (axis description cs:0.47,0.6) {};
\node[pin=70:{p(u) has the lease bias}] at (axis description cs:0.65,0.3) {};
\node[pin=70:{p(w) has the lease variance}] at (axis description cs:0.85,0.3) {};
\node[pin=270:{$\theta$}] at (axis description cs:0.5,0.1) {};
\draw[dashed] (axis description cs:0.5,0) -- (axis description cs:0.5,0.92);
\end{axis}
\end{tikzpicture}

-
–  hpesoj626 Oct 26 '12 at 23:44
I edited my answer to the other question, and changed to the axis cs coordinate system. –  Gonzalo Medina Oct 27 '12 at 2:26

Here's a possibility; this time, I used the axis cs coordinate system (I wasn't sure about the position of the theta and its arrow since the original drawing is not clear in this part):

\documentclass{article}
\usepackage{pgfplots}

\newcommand\gauss[2]{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}
% Gauss function, parameters mu and sigma

\begin{document}

\begin{tikzpicture}[
every pin edge/.style={<-},
every pin/.style={fill=yellow!50,rectangle,
rounded corners=3pt,font=\footnotesize},
mylabel/.style={fill=yellow!50,rectangle,
rounded corners=3pt,font=\footnotesize,align=center}]
\begin{axis}[every axis plot post/.append style={
mark=none,domain=-8:20,samples=50,smooth},
clip=false,
axis lines=none,
]

\def\puxpos{1}
\def\pvxpos{2.5}
\def\pwxpos{16}

\draw[dashed] (axis cs:\pvxpos,0) -- (axis cs:\pvxpos,0.4);
\draw[dashed] (axis cs:\pwxpos,0) -- (axis cs:\pwxpos,0.5);

\node[pin=270:{$\theta$}] at (axis cs:1,0.065) {};
\node[mylabel] at (axis cs:\pvxpos,0.48) (pv) {MOST EFFICIENT \\ $V$ has least MSE \\ $p(v)$};
\node[mylabel] at (axis cs:-8.4,0.09) (pu) {$U$ has \\least bias \\ $p(u)$};
\node[mylabel] at (axis cs:\pwxpos,0.62) (pw) {$W$ has \\ least variance \\ $p(w)$};
\end{axis}
\end{tikzpicture}

\end{document}


-
Amazing! Thank you very much! –  ealfons1 Oct 27 '12 at 13:21