# PGFplots: using the table feature

I have 4 sets of data that all have the same t values (x axis). Can all list be read in at once?

\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat = 1.10}
\begin{document}
\begin{axis}
t  actual  measured  est Q = 0.01  est Q = 0.1
.1  .1     .2107      .2107         .2107
.2  .2     .5954      .4122         .4671
.3  .3     .5940      .4820         .5464
.4  .4     .4758      .4800         .5027
.5  .5     .3183      .4207         .3661
.6  .6     .4060      .4131         .3833
}
\end{axis}
\end{document}


Can 4 lines be read in like this? If so, how can I differentiate them with 4 different markers?

-

Yes, absolutely:

The idea is to read the data into a macro (called \mydata in the code below), and then you can use, for example:

  \addplot table[x=t,y=actual]{\mydata};


and specify the x and y as you wish.

Note that if you want to use spaces in the column names, then you need to enclose them in braces; for example, you'll note that I used {est Q = 0.1} in both the column name and the addplot command.

Here's a complete MWE that demonstrates the idea.

% arara: pdflatex
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat = 1.10}
\begin{document}

t  actual  measured  {est Q = 0.01}  {est Q = 0.1}
.1  .1     .2107      .2107         .2107
.2  .2     .5954      .4122         .4671
.3  .3     .5940      .4820         .5464
.4  .4     .4758      .4800         .5027
.5  .5     .3183      .4207         .3661
.6  .6     .4060      .4131         .3833
}\mydata
\begin{tikzpicture}
\begin{axis}

@dustin you'll have to change the pgfplotstableread command to include the comma, not the addplot command. But, yes, overall, it will work –  cmhughes May 4 '14 at 23:47