我有下面的条形图。我想按颜色将条形图分组。直接比较箱体是没有意义的,只能直接比较具有相同颜色的值。有没有办法在同一个图表区域中创建两个子条形图。例如“左侧只有蓝色条形图”,“右侧只有红色条形图”。
我目前以这种方式创建图形
\begin{tikzpicture}
\begin{axis}[
ybar,
ymin=80,
ymax=85,
height=5cm,
width=9cm,
symbolic x coords={Baseline, +WebDict, +NewsDict},
ylabel=Accuracies (test set),
enlarge x limits=0.25,
legend style={at={(-0.05,1.0)},
anchor=west,legend columns=-1},
nodes near coords,
nodes near coords align={vertical},
xtick=data
]
\addplot coordinates {(Baseline, 81.75) (+WebDict, 83.153) (+NewsDict, 83.16)};
\addplot coordinates {(Baseline, 83.02) (+WebDict,84.90) (+NewsDict,83.35)};
\addlegendentry[align=left]{English}
\addlegendentry[align=left]{German}
\end{axis}
\end{tikzpicture}