In this MWE
\documentclass[11pt, oneside, landscape]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usetikzlibrary{
calc,
intersections,
}
\usepgfplotslibrary{fillbetween}
\begin{document}
\centering
\begin{tikzpicture}[line width=0.8pt, color=black, >=latex]
\begin{axis}[%
width=9cm,height=7cm, samples=250,
scale only axis,
axis lines = middle, hide y axis,
xmin=-2,xmax=3,xlabel={$r$},
ymin=0,ymax=0.5]
\coordinate (a) at (-1,0);
\coordinate (b) at (3,0);
\addplot[mark=none, line width=1pt, color=blue,domain=-2:3, name path=line 1] {(1/sqrt(2*pi))*e^-((x-1)^2/2)};
\addplot[mark=none, line width=1pt,color=red,domain=-2:3, name path=line 2] {(1/sqrt(2*pi))*e^-((x-2)^2/8)} ;
\draw[red, dashed, name intersections={of=line 1 and line 2,name=i, total=\t}] \foreach \s in {1,...,\t}{(i-\s) -- ($(a)!(i-\s)!(b)$)} ;
\end{axis}
\end{tikzpicture}
\end{document}
there is a fatal error, but if you compose without fillbetween library, the output is okay. There is not any error with TL2017. I know the fillbetween library is not necessary for this code. Any help?
