1

I was going through the code created by you Multiple Normal Curve... Really marvelous... Can anybody just help me in creating the figure like this?

enter image description here I am confused in how to set the axes...

Thanks in advance...

1 Answer 1

4

If you are only interested in the Gaussians, you may consider:

\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
 \foreach \i in {1,2,3}
 {
 \draw[gray](0.1+1.2*\i,0) -- (4.6+1.2*\i,3);
 \draw[variable=\x,domain=-1:1,blue,thick]
  plot ({\x+1.5*\i+1},{(exp(-2*\x*\x)+\i-1)});
 \draw[gray] (1.5*\i,\i-1) -- (2+1.5*\i,\i-1);
 \draw[gray] (1+1.5*\i,\i-1) -- (1+1.5*\i,\i);
 }
\end{tikzpicture}
\end{document}

enter image description here

EDIT: With changing widths:

\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
 \foreach \i in {1,2,3}
 {
 \draw[gray](0.1+1.2*\i,0) -- (4.6+1.2*\i,3);
 \draw[variable=\x,domain=-1:1,blue,thick]
  plot ({\x+1.5*\i+1},{(exp(-(2+2*(\i-1))*\x*\x)+\i-1)});
 \draw[gray] (1.5*\i,\i-1) -- (2+1.5*\i,\i-1);
 \draw[gray] (1+1.5*\i,\i-1) -- (1+1.5*\i,\i);
 }
\end{tikzpicture}
\end{document}

enter image description here

3
  • Thanks a lot @marmot for your prompt answer... Can I ask for another help? I want different means, different variances in each of these graphs... Can you please show some way how to do that? Commented Jan 17, 2018 at 20:40
  • @SandipanKarmakar Sure, if you tell me what prefactors of \x^2 in the exponentials you want ;-)
    – user121799
    Commented Jan 17, 2018 at 20:58
  • Thanks a lot @marmot for your help... Let me try this by my own then I will get back to you... Thanks again... Commented Jan 18, 2018 at 4:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .