I'm trying to make a graph, where the label y is the first column of the row and the x is the other columns (in the example it is from IPT1 to IPT7, but it is much more).
I believe it would be a type of histogram or similar to the graphs of electoral surveys (the candidate's name and percentage appears month by month).
I made the code below, but I'm not getting the expected result. The data is generated from a C ++ code (which processes several files and gives the history of the indexes over time).
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usepackage{filecontents}
\begin{filecontents}{data.dat}
Team;IPT1;IPT2;IPT3;IPT4;IPT5;IPT6;IPT7
Tiger;1;2;3;4;5;6;7
XPO ;3;5;7;9;11;13;15
ABC ;5;8;11;14;17;20;23
\end{filecontents}
\begin{document}
\pgfplotstableread[col sep=semicolon]{data.dat}\datatable
\begin{tikzpicture}
\begin{axis}[
yticklabels from table={\datatable}{Team},
ytick=data,
xticklabel = {IPT1,IPT2,IPT3,IPT4,IPT5,IPT6,IPT7}, xtick=data,
]
\addplot table[
x=IPT1,
y expr=\coordindex,
] {\datatable};
\addplot table[
x=IPT2,
y expr=\coordindex,
] {\datatable};
\addplot table[
x=IPT3,
y expr=\coordindex,
] {\datatable};
\addplot table[
x=IPT4,
y expr=\coordindex,
] {\datatable};
\end{axis}
\end{tikzpicture}
\end{document}
I try put team names in y label and IPT labels on x axis...

Where am I going wrong? And is it possible to assemble a code that reads several columns after the team name (IPT1, IPT2, ..... IPTn)?



xticklabel = {IPT1,IPT2,IPT3,IPT4,IPT5,IPT6,IPT7},unless you have a completely different plot in mind in which the x coordinates are supposed to beIPT1,IPT2,IPT3,IPT4,IPT5,IPT6,IPT7. This you won't get withx=IPT1and so on. – Mar 10 '20 at 04:05