# Plotting this kind of graph in TikZ

I want to plot a graph that looks like this:

The graph needs to look like two bell curves. There's no specific functions or anything for it.

Here's what I have.

\begin{tikzpicture}
\draw[very thin,color=lightgray,step=0.5cm] (0,0) grid (6.1,3.6);
\draw[->] (0,0) -- (6.2,0) node[anchor=north] {$t$};
\draw[->] (0,0) -- (0,3.7) node[anchor=east] {$v$};
\draw
(0,0) node[anchor=north] {0}
(1,0) node[anchor=north] {10}
(2,0) node[anchor=north] {20}
(3,0) node[anchor=north] {30}
(4,0) node[anchor=north] {40}
(5,0) node[anchor=north] {50}
(0,1) node[anchor=east] {5}
(0,2) node[anchor=east] {10}
(0,3) node[anchor=east] {15};
\draw[thick,color=blue] (0,0) to [out=0,in=180] (1,3);
\draw[thick,color=blue] (1,3) to [out=0,in=180] (2,0);
\draw[thick,color=blue] (2,0) to (4,0);
\draw[thick,color=blue] (4,0) to [out=0,in=180] (5,3);
\draw[thick,color=blue] (5,3) to [out=0,in=180] (6,0);
\end{tikzpicture}


As you can see it doesn't really look like bell curves.

I'm very new to TikZ and this is the only way I know how to plot. Please help!

• Do you have more details, such as the value of v when t is 2,4,6,8 or 12,14,16,18... It will be easier to draw with those value – user156344 Nov 3 '18 at 13:38
• It's an arbitrarily drawn graph, no points whatsoever. – Steven Sun Nov 3 '18 at 14:12

Welcome to TeX.SE! You can plot arbitrary functions. Note that you'd probably make your life more comfortable by drawing this with pgfplots.

\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}[declare function={Gaussian(\x,\y,\z)=exp(-\z*(\x-\y)*(\x-\y));}]
\draw[very thin,color=lightgray,step=0.5cm] (0,0) grid (6.1,3.6);
\draw[->] (0,0) -- (6.2,0) node[anchor=north] {$t$};
\draw[->] (0,0) -- (0,3.7) node[anchor=east] {$v$};
\draw
(0,0) node[anchor=north] {0}
(1,0) node[anchor=north] {10}
(2,0) node[anchor=north] {20}
(3,0) node[anchor=north] {30}
(4,0) node[anchor=north] {40}
(5,0) node[anchor=north] {50}
(0,1) node[anchor=east] {5}
(0,2) node[anchor=east] {10}
(0,3) node[anchor=east] {15};
\draw[thick,color=blue] plot[domain=0:2,variable=\x,samples=101]
({\x},{3*Gaussian(\x,1,5)});
\draw[thick,color=blue] plot[domain=4:6,variable=\x,samples=101]
({\x},{3*Gaussian(\x,5,5)});
\end{tikzpicture}
\end{document}


Just for fun: a quick pgfplots variant.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}[declare function={Gaussian(\x,\y,\z)=exp(-\z*(\x-\y)*(\x-\y));}]
\begin{axis}[axis lines=left,grid=major,xmin=0,xmax=72,ymin=0,ymax=22,
xlabel=$t$,ylabel=$v$]

• @StevenSun In your example, you have \draw (0,0) node[anchor=north] {0} ...., the analogous lines are not there in the pgfplots variant. – marmot Nov 3 '18 at 15:01