Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

What I want:

enter image description here

This is what I have so far in terms of code:

% Gauss function, parameters mu and sigma

\begin{axis}[every axis plot post/.append style={
  mark=none,domain=-2:3,samples=50,smooth}, % All plots: from -2:2, 50 samples, smooth, no marks
axis x line*=bottom, % no box around the plot, only x and y axis
axis y line*=left, % the * suppresses the arrow tips
enlargelimits=upper] % extend the axes a bit to the right and top
\addplot {\gauss{0}{0.5}};
\addplot {\gauss{1}{0.75}};
share|improve this question
Welcome to TeX.SE. –  Peter Grill Oct 26 '12 at 21:39
Possible Duplicate: Bell Curve/Gaussian Function in TikZ/PGF and Plotting bell shaped curve in TikZ-PGF. Please see if these answer your question as then we can close this as a duplicate. –  Peter Grill Oct 26 '12 at 21:40
Could you be more specific about what you're having problems with? All you need to do is adjust the parameter for the second gaussian to make it use the same expected value as the first. –  Jake Oct 26 '12 at 21:53
When you cut and past code form another place, you should provide that info in the question. As another comment pointed out, the code given in the question is directly copied form the first link I provided. –  Peter Grill Oct 26 '12 at 21:59
My apologies for not adhering to the proper question etiquette Mr. Grill. In terms of being specific, I guess I am having trouble producing the "flatter" of the two functions above. Also, I am unaware of how to add some directional arrows (labeled ones) to the graphs as depicted above. –  ealfons1 Oct 26 '12 at 22:05
show 1 more comment

1 Answer

up vote 7 down vote accepted

One possibility:


% Gauss function, parameters mu and sigma


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 y line=none,
axis x line*=bottom,
\addplot {\gauss{0}{0.5}};
\addplot {\gauss{0}{1}};
\node[pin=70:{$\hat{\theta}_1$}] at (axis cs:0.57,0.5) {};
\node[pin=70:{$\hat{\theta}_2$}] at (axis cs:1,0.25) {};
\node[pin=270:{$\theta=E(\hat{\theta}_1)=E(\hat{\theta}_2)$}] at (axis cs:0,0) {};
\draw[dashed] (axis description cs:0.5,0) -- (axis description cs:0.5,0.92);


enter image description here

share|improve this answer
Amazing, thank you very much! –  ealfons1 Oct 26 '12 at 22:07
add comment

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.