pgfplots: addplot에서 노드 레이블의 수직 위치를 변경합니다.

pgfplots: addplot에서 노드 레이블의 수직 위치를 변경합니다.

아래 MWE에서 label곡선과 관련된 수직 위치를 어떻게 변경할 수 있습니까? 예를 들어 곡선 아래에 놓고 싶다면?

\documentclass{standalone}

\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}

\begin{document}

    \begin{tikzpicture}
    \begin{axis} []

    \addplot[
        domain=10:400,
        samples=100,
    ] { sqrt(x)}
    node[pos=0.97,label={$f(x)$}] {}
    ;

    \end{axis}
    \end{tikzpicture}

\end{document}  

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

답변1

label=below:{$f(x)$}평소대로 사용하시면 됩니다 . 등 right의 모든 위치 지정자가 left below left작동합니다. 또한 label는 노드이므로 다음과 같이 다른 옵션도 전달할 수 있습니다.

label={[text=red]below:{$f(x)$}}

암호:

\documentclass{standalone}

\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}

\begin{document}

    \begin{tikzpicture}
    \begin{axis} []

    \addplot[
        domain=10:400,
        samples=100,
    ] { sqrt(x)}
    node[pos=0.97,label=below:{$f(x)$}] {}
    ;

    \end{axis}
    \end{tikzpicture}

\end{document}

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

관련 정보