0

I have 2 questions to do with gnuplot:

  1. How can I access a specific value from a data file?
  2. Can I plot that value against a column?

I have the following script:

plot for [iter=0:3:1] path_to_data using 1:(column(iter))

I would like to plot additional lines on this graph, based on values stored in path_to_expt.

The problem is that I want to plot an x value from one file (path_to_data: column(1)) against a constant y value from another file (path_to_expt). Is this possible?

I'm not sure of the syntax to access a cell from a file but the y value is stored at: path_to_expt[row(iter), column(1)].

Can I set a variable (expt_value) inside the above loop, equal to the y value, and plot it against path_to_sim[column(1)] as follows:

plot for [iter=0:3:1] path_to_data using 1:(column(iter)) , \
expt_value = path_to_expt[row(iter), column(1)] , \
path_to_sim using 1:expt_value

I tried this but my syntax is wrong and I can't find how to access a single value from a file. I don't know if I'll be able to plot a single value against a column but, if not, perhaps I could make a column of constant values to do this. Thank you for your help.

Shenan
  • 425
  • 2
  • 9
  • 20
  • 1
    There are several questions on SO about how to extract single values from a data file, e.g. [Gnuplot: How to load and display single numeric value from data file](http://stackoverflow.com/q/18583180/2604213). – Christoph Nov 07 '14 at 13:58
  • Very helpful,comment! – Shenan Nov 10 '14 at 16:40

0 Answers0