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}};
  • 1
    Welcome to TeX.SE. – Peter Grill Oct 26 '12 at 21:39
  • 2
    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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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