TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

Gauss picture

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:

every pin edge/.style={<-},
every pin/.style={fill=yellow!50,rectangle,rounded corners=3pt,font=\small}]
\begin{axis}[every axis plot post/.append style={
axis lines=none
\addplot {\gauss{-1.5}{1}};
\addplot {\gauss{1}{3}};
\addplot {\gauss{3}{3.1}};
\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);
share|improve this question
Related: tex.stackexchange.com/questions/43610/… – 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
up vote 4 down vote accepted

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):


% Gauss function, parameters mu and sigma


every pin edge/.style={<-},
every pin/.style={fill=yellow!50,rectangle,
  rounded corners=3pt,font=\footnotesize},
  rounded corners=3pt,font=\footnotesize,align=center}]
\begin{axis}[every axis plot post/.append style={
axis lines=none,


\addplot {\gauss{\puxpos}{3}};
\addplot {\gauss{\pvxpos}{1}};
\addplot {\gauss{\pwxpos}{0.75}};

\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)$};


enter image description here

share|improve this answer
Amazing! Thank you very much! – ealfons1 Oct 27 '12 at 13:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.