答案1
这可能可以作为一个问题的基础,将受到更多的赞赏。我很乐意删除它。
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{patterns}
\definecolor{lazy}{RGB}{189,208,112}
\begin{document}
\begin{tikzpicture}[declare function={gauss(\x,\y)=exp(-(\x/\y)*(\x/\y));}]
\draw (-5,0) -- (5,0)node[below right]{$\mu$};
\draw (0,0) -- (0,4) node[above]{$f(x)$};
\path[pattern color=lazy,pattern=vertical lines]
plot[variable=\x,domain=-2:3,smooth] ({\x},{3*gauss(\x+2,1.5)}) -| cycle;
\draw[color=lazy] plot[variable=\x,domain=-5:3,smooth] ({\x},{3*gauss(\x+2,1.5)});
\path[pattern color=red,pattern=vertical lines]
plot[variable=\x,domain=-5:-2,smooth] ({\x},{3*gauss(\x,1.5)}) |- cycle;
\draw[color=blue] plot[variable=\x,domain=-5:5,smooth] ({\x},{3*gauss(\x,1.5)});
\end{tikzpicture}
\end{document}