My question is somewhat related to this thread. I would like to create box plots from a file. The file (in my case a CSV) looks like this:
Upper,Lower,Min,Max,Median,Name
3,1,0,4,2,First
4,2,1,5,3,Second
...
There are multiple rows, each of which contains fields describing the data points for the box plot (median, position of the whiskers and the box boundaries) and the name of the data set. I would like to create a number of box plots from this data. The name should be added as a legend entry.
I have tried using a CSV reader:
\begin{tikzpicture}
\begin{axis}[
\csvreader[
head to column names,
separator=comma]
{data.csv}{}% use head of csv as column names
{
\addplot+ [
boxplot prepared={
lower whisker=\Min,
lower quartile=\Lower,
median=\Median,
upper quartile=\Upper,
upper whisker=\Max,
},
] coordinates {};
}
\end{axis}
\end{tikzpicture}
This produces an empty plot though. My guess is that the macros (\Min and so on) do not work properly in the tikzpicture / axis environment?! (It works when I just dump out the values outside of the picture).
I also took a look at the thread mentioned above. The problem in this case is that only the first row of the table is plotted whereas I would like to plot all of them. This shortcoming is mentioned in the comments, but no extension of the approach is mentioned.
What is the best way to add the plots?

namethe item on the x-axis? – Sal Jr Nov 12 '18 at 18:49xtick={1,2}, xticklabels from table={\datatable}{name}to theaxisoptions? – Torbjørn T. Nov 12 '18 at 19:22xticsfrom the # of rows in\datatable? – Sal Jr Nov 12 '18 at 23:44