如何才能有这样的轴标签(x
以及z
轴附近):
答案1
您可以通过设置将轴标签放置在轴线的尖端
axis lines=middle,
xlabel=$x$, xlabel style={at=(current axis.right of origin), anchor=west},
ylabel=$y$, ylabel style={at=(current axis.above origin), anchor=south}
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
xlabel=$x$, xlabel style={at=(current axis.right of origin), anchor=west},
ylabel=$y$, ylabel style={at=(current axis.above origin), anchor=south},
xtick=\empty, ytick=\empty
]
\addplot [very thick, domain=0:10] {x+rnd};
\end{axis}
\end{tikzpicture}
\end{document}