我使用的是pgfplots
1.7。下图中未显示条形的标签。
\documentclass{article}
\usepackage{pgfplots}
%\usepackage{pgfplotstable}
\pgfplotsset{compat=1.7}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xbar stacked,
clip=false,
enlarge y limits=0.05,
tick label style={font=\footnotesize},
label style={font=\footnotesize},
width=7cm,
height=6.5cm,
bar width=3mm,
xlabel={Percentage of verification tasks for which a tool was chosen, \%},
nodes near coords,
symbolic y coords={Overall,Sequentialized,Recursive,MemorySafety,HeapManipulation,DeviceDrivers64,ProductLines,Loops,ControlFlowInteger,ControlFlow,Concurrency,BitVectors},
ytick={Overall,Sequentialized,Recursive,MemorySafety,HeapManipulation,DeviceDrivers64,ProductLines,Loops,ControlFlowInteger,ControlFlow,Concurrency,BitVectors},
]
\addplot+[point meta=explicit symbolic] coordinates {
(27.04,Overall) [cb]
(36.36,Sequentialized) [cb]
(89.89,Recursive) [cb]
(53.88,MemorySafety) [cb]
(41.90,HeapManipulation) [cb]
(30.84,DeviceDrivers64) [cb]
(0,ProductLines) [cb]
(57.63,Loops) [cb]
(23.80,ControlFlowInteger) [cb]
(12.37,ControlFlow) [cb]
(16.61,Concurrency) [cb]
(42.02,BitVectors) [cb]
};
\end{axis}
\end{tikzpicture}
\end{document}
不过,我需要在每个条形内添加“cb”标签。非常感谢!