龙卷风图中的标签条(LaTeX、Pgfplots)

龙卷风图中的标签条(LaTeX、Pgfplots)

我正在制作龙卷风图,想标记 6 条水平线。到目前为止,我得到的是:

\pgfplotsset{TornadoPlot/.style={width=\textwidth,height=8cm, xmin=-20,xmax=20, line width=1pt, tick style={line width=0.8pt},xmajorgrids=true, minor x tick num=1, tick align=outside, tick pos=left, xbar, bar shift=0pt, enlarge y limits=0.1, ytick distance=1, ytick=\empty, visualization depends on={rawx \as \rawx}, nodes near coords={\pgfmathprintnumber{\rawx}}, before end axis/.code={
        \draw  ({rel axis cs:0,0} -| {axis cs:0,0})
            -- ({rel axis cs:0,1} -| {axis cs:0,0});},},}
\begin{figure}[H]
\begin{mdframed}
\begin{tikzpicture}
    \begin{axis}
        [
        TornadoPlot,
        legend style={at={(0.55, -0.1)}, legend columns=-1, draw=none, text width=7em, anchor=north},
        % and we want to limit the range of the bars to the axis limits
        restrict x to domain*={\pgfkeysvalueof{/pgfplots/xmin}:\pgfkeysvalueof{/pgfplots/xmax}},
        ]
            \addplot [fill=black!80] coordinates
            {(-6,3) (-5,2) (-1,1)};
            \addplot [fill=black!10]   coordinates
            {(14,5) (10,4) (14,3) (18,2) (10,1) (6,0)};
            \legend{not supported, supported}
    \end{axis}
    \node[font=\large\bfseries, yshift=2em] (title) at (current bounding box.north){Support in the Literature};
\end{tikzpicture}
\end{mdframed}
\vspace{-1em}\caption{Support in the Literature for all the Trust Factors}
\end{figure}

我想要给 6 个条形图分别贴上一个名字。

这是我目前得到的

相关内容