TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have several data files that I would like to combine into one table using pgfplots table. Specifically, I would like to use one file to set the first three columns and then have each data file fill in another column after that (the first two columns are experimental parameters, consistent in every file). The files are tab delineated.

Can I set pgfplots up to do this, and if so, how? I've dug through the manual and tried using pgfplotscreatecolumn and createonuse but neither one seems to be suited to the task.

share|improve this question
up vote 13 down vote accepted

You can do this using the copy column from table option of the \pgfplotstablecreatecol command (see p. 39 of the pgfplotstable manual).

Given the two files

4.1 .1 1.1       
3.2 .2 1.2
5.3 .3 1.3

-1 0
2  1
4  -1

You can add the columns from to the first table like so:




\pgfplotstablecreatecol[copy column from table={\dataB}{[index] 0}] {par1} {\dataA}
\pgfplotstablecreatecol[copy column from table={\dataB}{[index] 1}] {par2} {\dataA}

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.