TransWikia.com

PGFplots Boxplot, using values of median, quartile... outside axis environment

TeX - LaTeX Asked on October 4, 2021

I try to make some boxplots to some given data and use the calculated values (pgfplots did) of the median, quartiles, average,… outside the axis environment.

My MWE:

documentclass[utf8,fleqn]{scrartcl}
usepackage[ngerman]{babel}
    

usepackage{pgfplots}
usepgfplotslibrary{statistics}
usepackage{filecontents}


begin{document}

begin{filecontents*}{jobname.csv}
v
0.1
0.2
0.3
0.8
0.9
1.0 
1.5
 end{filecontents*}


begin{tikzpicture}[scale=1]
begin{axis}[
boxplot,
table/y=v,
xmin=0, xmax=1.6, 
ymin=0, ymax=2,
]
    addplot[fill=orange, thick] table[] {jobname.csv} 
[above]
node at (boxplot box cs: boxplotvalue{median},1){Median pgfmathprintnumber{boxplotvalue{median}}}
;

end{axis}
end{tikzpicture}


end{document}

I can view the values inside the plot, but any attempt to use it outside failed up to now. Any def, xdef, did not work.

Any suggestions?
Thanks very much.

One Answer

Finally I found the place to define the values:

    addplot[fill=orange, thick] table[] {jobname.csv} 
[above]
node at (boxplot box cs: boxplotvalue{median},1){Median pgfmathprintnumber{boxplotvalue{median}}xdefmed{boxplotvalue{median}}xdefuq{boxplotvalue{upper quartile}}xdeflq{boxplotvalue{lower quartile}}xdefuw{boxplotvalue{upper whisker}}xdeflw{boxplotvalue{lower whisker}}xdefav{boxplotvalue{average}}}
;

Answered by Arno on October 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP