我正在使用Latex Beamer准备演示文稿。我决定包括一个地块。
中间曲线应该是正态分布;但它有尖锐的角落。为什么会这样?
还可以删除y轴上的刻度吗?
这是我的代码:
\begin{frame}
\begin{tikzpicture}
\begin{axis}[domain=-1:1]
\addplot+[no markers] {4*exp(-4*(x+1))};
\addplot+[no markers] {1/sqrt(2*pi*0.02)*exp(-(x^2)/(2*0.02))};
\addplot+[no markers] {4*exp(4*(x-1))};
\end{axis}
\end{tikzpicture}
\end{frame}
谢谢
要获得平滑曲线,请增加采样点的数量,例如samples=100
要删除y轴标签:yticklabels=\empty
\documentclass{beamer}
\usepackage{pgfplots}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\begin{axis}[domain=-1:1,samples=100,yticklabels=\empty]
\addplot+[no markers] {4*exp(-4*(x+1))};
\addplot+[no markers] {1/sqrt(2*pi*0.02)*exp(-(x^2)/(2*0.02))};
\addplot+[no markers] {4*exp(4*(x-1))};
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}