좌표 근처 노드의 텍스트 노드

좌표 근처 노드의 텍스트 노드

에 대한 사용자 정의된 텍스트 노드 레이블을 갖고 싶습니다 nodes near coords. 예를 들어 각 막대의 오른쪽에 있는 숫자(7,10,15 ...) 대신 일부 텍스트를 갖고 싶습니다.

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}[scale=0.85]
\begin{axis}[xbar,tick align=outside,
             width=11cm,
             height=8cm,
             bar width={10pt},
             enlargelimits=0.13,
             nodes near coords,
             nodes near coords align=horizontal,
             xlabel=\textbf{Number of Finals Won},
             xtick={10,20,30,40,50,60},
             ytick={1,2,3,4,5,6},
             yticklabels={Kerry,Laois,London,Waterford,Clare,Offaly},
             xticklabels={a,b,c,d,e,f,g},
            ]
\addplot
[draw=blue,fill=blue!15]
coordinates
{(10,1) (15,2) (10,3) (35,4) (30,5) (40,6)};
\addplot
[draw=blue,fill=red!15]
coordinates
{(10,1) (10,2) (20,3) (50,4) (7,5) (22,6)};
\end{axis}
\end{tikzpicture}
\end{document}

감사해요.

답변1

당신이 구체적이지 않았기 때문에 나는 당신이 다음과 같은 것을 의미한다고 추측했습니다 ...

% used PGFPlots v1.14
\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\begin{document}
    \begin{tikzpicture}
        \begin{axis}[
            xbar,
            tick align=outside,
            width=11cm,
            height=8cm,
            bar width={10pt},
            enlargelimits=0.13,
            nodes near coords,
            nodes near coords align=horizontal,
            nodes near coords style={
                anchor=west,
            },
            xlabel=\textbf{Number of Finals Won},
            xtick={10,20,30,40,50,60},
            ytick={1,2,3,4,5,6},
            yticklabels={Kerry,Laois,London,Waterford,Clare,Offaly},
            xticklabels={a,b,c,d,e,f,g},
            point meta=explicit symbolic,
        ]
            \addplot [draw=blue,fill=blue!15] coordinates {
                (10,1) [Unfortunately]
                (15,2) [you]
                (10,3) [didn't]
                (35,4) [tell]
                (30,5) [us]
                (40,6) [*what*]
            };
            \addplot [draw=blue,fill=red!15] coordinates {
                (10,1) [text]
                (10,2) [you]
                (20,3) [want]
                (50,4) [to]
                (7,5)  [be]
                (22,6) [displayed]
            };
        \end{axis}
    \end{tikzpicture}
\end{document}

위 코드의 결과를 보여주는 이미지

관련 정보