Latex 乳胶柱形图

Latex 乳胶柱形图,latex,tikz,pgf,Latex,Tikz,Pgf,正在尝试创建一个latex柱形图,其中3个不同的柱中有3种颜色的单个值 \begin{tikzpicture} \begin{axis}[ x tick label style={ /pgf/number format/1000 sep=}, ylabel=Accuracy, enlargelimits=0.05, legend style={at={(0.5,-0.15)}, anchor=north,legend columns=-1}, ybar interval=0.7,

正在尝试创建一个latex柱形图,其中3个不同的柱中有3种颜色的单个值

\begin{tikzpicture}
\begin{axis}[
x tick label style={
    /pgf/number format/1000 sep=},
ylabel=Accuracy,
enlargelimits=0.05,
legend style={at={(0.5,-0.15)},
    anchor=north,legend columns=-1},
ybar interval=0.7,]
\addplot 
 coordinates {(1930,80)};
\addplot 
  coordinates {(1930,80)};
\addplot 
coordinates {(1930,80)};
\legend{Far,Near,Here}
\end{axis}
\end{tikzpicture}

您需要添加ybar大小(例如,
ybar=5pt
)并删除
ybar间隔
参数,该参数看起来是假的:

\begin{tikzpicture}
    \begin{axis}[
        ybar=5pt,
        ylabel=Accuracy,
        xtick=data,
        legend style={at={(0.5,-0.15)}, anchor=north,legend columns=-1},
        x tick label style={/pgf/number format/1000 sep=},
        enlargelimits=0.05,
    ]
        \addplot coordinates {(1930,80)};
        \addplot coordinates {(1930,80)};
        \addplot coordinates {(1930,80)};
        \legend{Far,Near,Here}
    \end{axis}
\end{tikzpicture}

如何在绘图之间添加间隙您可以使用
ybar
参数在钢筋之间添加间隙。我用
5pt
的例子更新了答案。