I would like to know how can I choose a column from a multiple data file, and how can I operate with them.

I mean in gnuplot I used this code to plot the second column depending on the first and also take the minus one time the second.

plot "file.dat" u 1:($2*(-1))

So could someone help me which is the equivalent of using in tikz? Thank you!

  • 1
    Just a hint: try pgfplots package and search for x= or y=, these parameters load a specific named column from a given table. Or try x index= and y index= if you have a table with columns without names. – Malipivo Mar 20 '15 at 19:06
  • Thank you, but I tried this version, and I get this error message: package pgfkeys error:I do not know the key '/tikz/x index',to which you passed '1' and I am going to ignore it. – Hajnalka Mar 20 '15 at 19:10
  • 1
    You have to use PGFPlots for this, pure TikZ can not access different columns of a data file. – Jake Mar 20 '15 at 19:36
  • You can use raw gnuplot in PGFPlots like in this answer by @Jake: tex.stackexchange.com/a/37553/8650 – hpekristiansen Mar 21 '15 at 6:58

Browse other questions tagged or ask your own question.