0
votes

I am trying to plot some functions that I exported from octave.

The files are structured as follows:

Every line has a number that corresponds to f(something) and only that number.

For example the y(x) = x for x in [0:10] with step .1 function would have a file like this:

0
0.1
0.2
0.3

and so on...

By default gnuplot plots everything like it is f(line_number) = number_on_the_line

This something changes for every file, some are between (-100,100) with step of .1 and others are between (0,2000) with a step of 1.

How can I force gnuplot to use my range to correspond the number on the line?

I tried set xrange [-100:100] but this doesn't plot anything for [-100:0] since there are no negative lines.

1

1 Answers

1
votes

You must transform the line number (zeroth column) so that it matches your expected x-value. For the xrange from -100 to 100 in steps of 0.1 use

x(n) = -100 + 0.1 * n
plot 'file' using (x($0)):1