如何使该条形图可见?

如何使该条形图可见?

我试图可视化大约 21 个数据点,每个数据点为 3 个不同的任务提供不同的值,因此有 63 个唯一值需要绘制。我尝试使用 pgfplots 彩色条形图,但我认为它不适合这么多值。

什么样的 pgfplot 对象可以以可见但紧凑的方式可视化所有这些信息?

这是我试过的代码片段,但什么都看不到。请注意,它应该作为 PowerPoint 的幻灯片显示。

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{ifsym}
\usepackage{latexsym}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tipa}
\usepackage{textcomp}
\usepackage{tikz}
\usepackage{pgf}
\usepackage{pgfplots}
\pgfplotsset{width=9cm,compat=1.8}
\geometry{a4paper}
\usepackage[francais]{babel}


\begin{document}
\begin{tikzpicture}
\begin{axis}[
    ybar,
    enlargelimits=0.01,
    legend style={at={(0.5,-0.15)},
      anchor=north,legend columns=-1},
    ylabel={Fleiss' Kappa ($\kappa$)},
    symbolic x coords={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21},
    xtick=data,
    nodes near coords,
    every node near coord/.append style={font=\tiny},
    nodes near coords align={vertical},
    ]
\addplot coordinates {(0,0.820634615371) (1,0.749387104566) (2,0.877447627014) (3,0.730605521817) (4,0.721264576953) (5,0.712448104015) (6,0.826797749795) (7,0.799574244172) (8,0.787091644026) (9,0.684913627639) (10,0.789086760885) (11,0.857439617666) (12,0.769566208744) (13,0.789140742617) (14,0.819340189949) (15,0.761357917856) (16,0.763339845644) (17,0.781999988453) (18,0.780287210131) (19,0.784426418352) (20,0.830249577644) (21,0.786997332153) };
\addplot coordinates {(0,0.727817235623) (1,0.592538358694) (2,0.78693376975) (3,0.584645806506) (4,0.538797814208) (5,0.436852461868) (6,0.649525469688) (7,0.689025281309) (8,0.668929736629) (9,0.54126153079) (10,0.652943662285) (11,0.760376697542) (12,0.612274466328) (13,0.650077459334) (14,0.687853221054) (15,0.606652052744) (16,0.595731324545) (17,0.60288782204) (18,0.651691287007) (19,0.658387934883) (20,0.691156421819) (21,0.626229085368) };
\addplot coordinates {(0,0.923513766084) (1,0.88819167142) (2,0.908112351578) (3,0.911689335699) (4,0.837159871214) (5,0.904458598726) (6,0.916346564234) (7,0.925001847245) (8,0.916390264519) (9,0.751412429379) (10,0.903345724907) (11,0.861852433281) (12,0.909284725242) (13,0.850416171225) (14,0.898665795911) (15,0.889840905299) (16,0.836666666667) (17,0.97851453973) (18,0.900727763203) (19,0.902897112976) (20,0.903973152915) (21,0.922217720933) };
\legend{tokens,extents,matched extents}
\end{axis}
\end{tikzpicture}


\end{document}

答案1

也许只是一个简单的线条图?

在此处输入图片描述

代码:

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{width=9cm,compat=1.8}


\begin{document}
\begin{tikzpicture}
\begin{axis}[
%    ybar,
    enlargelimits=0.01,
    legend style={at={(0.5,-0.15)},
      anchor=north,legend columns=-1},
    ylabel={Fleiss' Kappa ($\kappa$)},
%    symbolic x coords={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21},
    xtick=data,
%    nodes near coords,
%    every node near coord/.append style={font=\tiny},
%    nodes near coords align={vertical},
    %% Added
    ymin = 0.4,
    ymax = 1,
    xticklabel style={font=\tiny}
    ]
\addplot coordinates {(0,0.820634615371) (1,0.749387104566) (2,0.877447627014) (3,0.730605521817) (4,0.721264576953) (5,0.712448104015) (6,0.826797749795) (7,0.799574244172) (8,0.787091644026) (9,0.684913627639) (10,0.789086760885) (11,0.857439617666) (12,0.769566208744) (13,0.789140742617) (14,0.819340189949) (15,0.761357917856) (16,0.763339845644) (17,0.781999988453) (18,0.780287210131) (19,0.784426418352) (20,0.830249577644) (21,0.786997332153) };
\addplot coordinates {(0,0.727817235623) (1,0.592538358694) (2,0.78693376975) (3,0.584645806506) (4,0.538797814208) (5,0.436852461868) (6,0.649525469688) (7,0.689025281309) (8,0.668929736629) (9,0.54126153079) (10,0.652943662285) (11,0.760376697542) (12,0.612274466328) (13,0.650077459334) (14,0.687853221054) (15,0.606652052744) (16,0.595731324545) (17,0.60288782204) (18,0.651691287007) (19,0.658387934883) (20,0.691156421819) (21,0.626229085368) };
\addplot coordinates {(0,0.923513766084) (1,0.88819167142) (2,0.908112351578) (3,0.911689335699) (4,0.837159871214) (5,0.904458598726) (6,0.916346564234) (7,0.925001847245) (8,0.916390264519) (9,0.751412429379) (10,0.903345724907) (11,0.861852433281) (12,0.909284725242) (13,0.850416171225) (14,0.898665795911) (15,0.889840905299) (16,0.836666666667) (17,0.97851453973) (18,0.900727763203) (19,0.902897112976) (20,0.903973152915) (21,0.922217720933) };
\legend{tokens,extents,matched extents}
\end{axis}
\end{tikzpicture}


\end{document}

相关内容