3

I have a question which sort of extends the page Multiple Files input to one pgfplotstable.

In the answer to this question, data is read from dataB.dat and subsequently appended to the data as described in dataA.dat.

I want to be able to take arbitrary columns from both dataA.dat and dataB.dat and create a new tabular with that data, instead of appending.

I looked in the pgfplotstable manual Revision 1.9 (2013/10/03) at section 4, but I can't to seem to solve the problem.

A minimal working example is

\documentclass{article}
\usepackage{pgfplotstable}
\begin{document}
    \pgfplotstablenew[]{3}{\dataC}
    \pgfplotstablecreatecol[copy column from table={dataA.dat}{[index]0}]{par1}{\dataC}
    \pgfplotstablecreatecol[copy column from table={dataB.dat}{[index]0}]{par2}{\dataC}
    \pgfplotstabletypeset
    [
        columns={par1,par2},
        columns/par1/.style=
        {
            column name=test1,
            sci,
            sci 10^e,
            precision=5,
        },
        columns/par2/.style=
        {
            column name=test2,
            sci,
            sci 10^e,
            precision=5,
        },      
    ]
    {\dataC}
\end{document}

It works, but I'm not sure if this is the correct way to do it. Is it?

  • 1
    you are not typesetting the first column as it is not in the list given to columns – percusse Jun 19 '14 at 14:15
  • @percusse Indeed. Thanks for the advice, I fixed the minimal working exmaple. But is this the correct way to do it? Or is there a better, perhaps neater, way? – Adriaan Jun 20 '14 at 9:26
  • You can provide the common options directly which would apply to all columns. Other than that it's pretty neat :) – percusse Jun 20 '14 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.