pgfplots: 다이어그램 중간에 xlabel을 이동합니다.

pgfplots: 다이어그램 중간에 xlabel을 이동합니다.

다이어그램 중앙에 xlabel을 정확히 가져오려면 무엇을 설정해야 합니까?

여기에 이미지 설명을 입력하세요

\documentclass[]{book}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}[font=\footnotesize]
\begin{axis}[
xlabel={This is the x-label},
xlabel style={fill=yellow,
at={([shift={(xticklabel* cs:0.5)}]yticklabel* cs:0.5)},
},
]
\end{axis}
\end{tikzpicture}
\end{document}

답변1

( 올바르게 xlabel style) 라벨 위치를 정의합니다.

\begin{document}
    \begin{tikzpicture}[font=\footnotesize]
\begin{axis}[
xlabel={This is the x-label},
xlabel style={fill=yellow,
               at={(0.5,0.5)}, anchor=center}, % <---
]
\end{axis}
    \end{tikzpicture}
\end{document}

여기에 이미지 설명을 입력하세요

관련 정보