我发现这个代码在Latex中绘制了Boxplot组,如果我想从表中读取Boxplot参数值,例如中位数,胡须值,我该如何修改此代码以便读取参数值而不是绝对数据
\documentclass[a4paper]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{statistics}
\pgfplotsset{compat=1.8}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
boxplot/draw direction=y,
cycle list={{red},{blue}},
boxplot={
draw position={1/3 + floor(\plotnumofactualtype/2) + 1/3*mod(\plotnumofactualtype,2)},
box extend=0.3
},
xtick={0,1,2,...,10},
x tick label as interval,
xticklabels={ {dataset 1},{dataset 2},{dataset 3} },
x tick label style={
text width=2.5cm,
align=center
},
]
\addplot
table[row sep=\\,y index=0] {
data\\
2.764\\
3.938\\
2.075\\
1.493\\
1.285\\
};
\addplot
table[row sep=\\,y index=0] {
data\\
1.175\\
2.813\\
2.006\\
3.893\\
2.012\\
};
\addplot
table[row sep=\\,y index=0] {
data\\
1.621\\
3.659\\
6.357\\
2.851\\
1.416\\
};
\addplot
table[row sep=\\,y index=0] {
data\\
2.280\\
1.482\\
1.787\\
2.326\\
1.795\\
};
\addplot
table[row sep=\\,y index=0] {
data\\
2.778\\
2.388\\
1.016\\
1.328\\
1.151\\
};
\addplot
table[row sep=\\,y index=0] {
data\\
1.028\\
1.571\\
4.090\\
3.875\\
1.890\\
};
\end{axis}
\end{tikzpicture}
\end{document}