Suppose I have a csv file with no titles in it just data. The first column is time (x axis) and the next 3 columns each construct a different set; that is, plot(t, col1) is one set of data, plot(t, col2), etc.
I can load the csv with the following command
\pgfplotstableread[col sep = comma]{data.csv}\mydata
How would I then plot each line?
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat = 1.10}
\pgfplotstableread[col sep = comma]{fexam1cdata.csv}\mydata
\begin{document}
\begin{tikzpicture}
\begin{axis}[
legend pos = south east,
xmin = 0,
xmax = 20,
ymin = 0,
ymax = 2.5
]
\addplot table[x = time, y = 2nd col]{\mydata};
\addplot table[x = time, y = 3rd col]{\mydata};
\addplot table[x = time, y = 4th col]{\mydata};
\addplot table[x = time, y = 5th col]{\mydata};
\legend{Actual, Measured, Est $Q = 0.01$, Est $Q = 0.1$}
\end{axis}
\end{tikzpicture}
\end{document}
Does pgfplots have an internal label name for each column? Can I change it to time, actual, measured, Q1, Q2?
In the code above, I used x = time and y = ith col to show what I want where. Those aren't correct and it wont compile since I don't know how to distinguish the columns in the csv file with pgfplots.
x index={0}, y index={1}... options not work for you? Also, if thex indexwill be the same for each plot, you can set it in theaxisoptions by addingtable/x index={0},(I'm not sure if thetable/is necessary, but I think it might be...)x = {0}, y = {1}?x index={0}, y index={0}. I wasn't sure if you had seen that option in the manual and weren't able to use it for some reason :-) In the pgfplots manual, version 1.10, its on page 49