![绘图显示不正确](https://linux22.com/image/465830/%E7%BB%98%E5%9B%BE%E6%98%BE%E7%A4%BA%E4%B8%8D%E6%AD%A3%E7%A1%AE.png)
我正在绘制一个函数图,我想在轴上标记两个点。其中一个点标记正确,但另一个点显示的是数字 4,而不是相应的字母。我该如何解决这个问题?
\documentclass{report}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
xlabel=$x$,
ylabel=$f_X(x)$,
ymin=0,
ymax=0.6,
xmax=8,
samples=100,
domain=-2:10,
every axis x label/.style={at={(current axis.right of origin)},anchor=west},
every axis y label/.style={at={(current axis.above origin)},anchor=south},
yticklabels={},
xticklabel={$\mu$},
xtick={4},
]
\pgfmathsetmacro{\mu}{4}
\pgfmathsetmacro{\theta}{1}
\addplot[blue, thick] {1/(sqrt(2*pi*\theta^2))*exp(-1/(2*\theta^2)*(x-\mu)^2)};
\node[below] at (axis cs:\mu, 0) {$\sim$};
\node[left] at (axis cs:0, {1/(sqrt(2*pi*\theta^2))}) {$\frac{1}{\sqrt{2\pi\theta^2}}$};
\draw[dashed] (axis cs: \mu,0) -- (axis cs: \mu, {1/(sqrt(2*pi*\theta^2))});
\end{axis}
\end{tikzpicture}
\end{document}