.png)
答案1
根本沒有足夠的採樣點:
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot[domain=0:360,samples=361]{cot(x)};
\end{axis}
\end{tikzpicture}
\end{document}
編輯:我注意到您的範例中 y 軸上的比例給出為 $n\cdot10^4$,問題的更完整描述是預設取樣選擇了一個非常接近 $0$ 的點,因此該值此時的$ \cot(x)$ 非常大,使得所有其他點都非常靠近x 軸。這裡也出現類似的效果:
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot[domain=-5:5,samples=1024]{cot(x)};
\end{axis}
\end{tikzpicture}
\end{document}
為了避免將來出現此類問題,請考慮是否有任何意外情況,系統會在函數的極值附近進行取樣。