使用符号坐标时 X 坐标上的多个标签

使用符号坐标时 X 坐标上的多个标签

我正在使用 pgfplots 绘制条形图;当我尝试使用符号标记 x 坐标时,标签会重复。任何想法为什么会这样,代码片段如下。

\begin{figure}[!h]
\centering
\begin{tikzpicture}
\begin{axis}[
x tick label style={
/pgf/number format/1000 sep=},
xlabel={Trace-sets},
ylabel={Number of Reference Points},
enlargelimits=0.15,
symbolic x coords={1, 2, 3},
legend style={at={(0.5,-0.2)},
anchor=north,
legend columns=-1},
ybar=5pt,
bar width=9pt,
nodes near coords,
grid=major
]
\addplot coordinates {(1,166) (2,612) (3,130)};
\addplot coordinates {(1,60) (2,612) (3,46)};
\legend{Offline, Online}
\end{axis}
\end{tikzpicture}
\caption{Number of reference points at which Signal Strengths were sampled}
\end{figure}

相关内容