Search code examples
gnuplot

Why plot with line doesn't work with gnuplot


I would like to plot a profile of temperature using line. My code :

set multiplot layout 2,2 rowsfirst

p for [i=1:5] './phi=0.0'.i.'/Field/Fields_1.00e+04_800.dat' u ($2==-5e-07?$1:1/0):4 w l lw 2 t 'phi=0.0'.i

p for [i=1:5] './phi=0.0'.i.'/Field/Fields_1.00e+04_800.dat' u ($2==-5e-07?$1:1/0):3 w lp t 'phi=0.0'.i

p for [i=1:5] './phi=0.0'.i.'/Field/Fields_1.00e+04_800.dat' u ($2==-5e-07?$1:1/0):6 w lp t 'phi=0.0'.i

p for [i=1:5] './phi=0.0'.i.'/Field/Fields_1.00e+04_800.dat' u ($2==-5e-07?$1:1/0):5 w lp t 'phi=0.0'.i

unset multiplot

What I get :

the output

As you can see on the first plot, nothing appears and I don't understand why ?

My data : https://drive.google.com/file/d/13ZvG4OsKfqMKavL7VsxLn5w688hvGfLH/view?usp=sharing

Is due to the blanks lines ?

Thank you !


Solution

  • Short answer:

    I guess it is a combination of filtered data and blank lines and the plotting style with lines.

    One possible solution:

    1. remove the blank lines
    2. and before your plotting commands add a line set datafile missing NaN

    There are other solutions in case you don't want to change your original data files.