有人知道如何删除 pgfplots 中 x 标签下方和 y 标签左侧的空白吗?(不是刻度和标签之间的空间 - 这对我来说不是问题)
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel={test label x},
ylabel={test label y},
every label/.style={fill=none,inner sep=-10pt}
]
\addplot+[mark=none]{x^2)};
\end{axis}
\end{tikzpicture}
\end{document}
多谢!
答案1
\documentclass[border=1cm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel={test label x},
ylabel={test label y},
xlabel near ticks,
ylabel near ticks,
%label style={inner sep=0pt}, %even less space
%tick label style={inner sep=0pt}, %even less space
]
\addplot[blue]{x^2)};
\end{axis}
\end{tikzpicture}
\end{document}