3
votes

My problem is that gnuplot does not draw any lines. That applies to linespoints and lines. Here is my script:

set terminal postscript 
set output "bla.eps"                                                         
set datafile separator "\t"     
set autoscale                                                                  
set grid
set yrange [0:12]                                                              
unset log
unset label                                                                    
set xtic auto   
set xtics font "Times-Roman, 10"                                               
set ytic auto 

plot "times.dat" using 1:($4/1000):xtic(1) title "naive" with linespoints lc rgb "red" pt 7 ps 1.3   

My .dat file has as the first column some data that I want to intepret as a text, while other columns are numbers. I just don't see any lines printed on the screen. Points are just fine. Even if I make the first column a number column, or I use lines, it doesn't matter, there is no line. Any clue?

2
Please show a few lines from your data file. Do you get any warning message? Do you have empty lines in the file? - Christoph
Yes, I did have empty lines and now I feel ashamed. If you put that as the answer, I will accept it. It might be good if you also list some common mistakes people might make so they have it here as a reference. - bellpeace

2 Answers

4
votes

A typical reason for having points drawn, but no connecting lines is the presence of blank lines in the data file:

Consider the data file

1

2

3

Plotted with

plot 'data.dat' using 0:1 with linespoints

it draws only the points, but no connecting lines.

This behavior is intended as it allows you to structure your data file, get these continuities where you want them, and allows you to access different parts of a data file using every or index (when having two blank lines).

0
votes

This does appear to be broken. I get I have blank lines in the file but it is unexpected behaviour.

plot "data.txt" using 1:2 with linespoints

Used to draw lines between the points but now it just draws the points; because of the blank lines.....

$ gnuplot --version gnuplot 5.0 patchlevel 3