我正尝试根据该表绘制一个图表:
ip Min Std
0 19.86764349 97.20356138
16 19.86764349 250.079659
22 19.86764349 168.2253117
23 19.86764349 169.2514577
33 19.86764349 142.664228
...
996 0.371543541 1.52E-07
997 0.371543312 1.85E-07
998 0.371543276 1.73E-07
999 0.371543154 1.97E-07
1000 0.371542976 1.99E-07
代码如下:
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
scale only axis,
enlargelimits=false,
stack plots=y,
area style
]
\addplot[] table [x=ip,y=Min] {dataTablaEstadisticas.dat}; closedcycle;
\addplot[draw=none,fill=green!50] table [x=ip,y=Std] {dataTablaEstadisticas.dat}; closedcycle;
\end{axis}
\end{tikzpicture}
\end{document}
我找不到我的错误。有什么建议吗?
答案1
该命令是\closedcycle
(带有反斜杠),并且需要在\addplot ... ;
命令内部、分号之前给出。
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
scale only axis,
enlargelimits=false,
stack plots=y,
area style
]
\addplot[] table [x=ip,y=Min] \dataTablaEstadisticas \closedcycle;
\addplot[draw=none,fill=green!50] table [x=ip,y=Std] \dataTablaEstadisticas \closedcycle;
\end{axis}
\end{tikzpicture}
\end{document}