Nefira
Nefira

Reputation: 85

Gnuplot : plot data from file using expressions fails

I am plotting some data (https://jpst.it/23X01) with gnuplot and I am having a weird problem when combining "using" with an expression on the columns.

The basic command gnuplot> plot "test.dat" u 1:4 w l works just fine and displays the following graph

complete curve with gnuplot

But if I use an expression instead gnuplot> plot "test.dat" u 1:($4) w l , some data is discarded.

curve with missing points

The discarded points seem to coincide with low y-values. The problem was observed with both v4.6 patchlevel 6 and v5.0 patchlevel 5.

Am I getting something wrong ? I have used this functionality of gnuplot several times in the past but never had this problem before. Thanks in advance.

Upvotes: 0

Views: 123

Answers (1)

Nefira
Nefira

Reputation: 85

I thought of deleting my question as I found my problem and it is silly, but since others might make the same mistake, I am leaving it for now.

My datafile was not formatted correctly and some columns were "jammed" together (I am amazed gnuplot managed to plot it with the first command). For example:

1415.8510073.5710065.88 61.32 61.58

instead of

1415.85 10073.57 10065.88 61.32 61.58

After I separated the columns correctly, everything went back in order.

Upvotes: 1

Related Questions