Reputation: 1335
I'm using gnuplot to plot a figure, but the plot keeps giving me different point types instead of a straight line. I want to plot them using only straight lines but keep getting x's or plus signs or different symbols. Here is what I have for the gnuplot script.
set terminal pdf
set output "temperatures.pdf"
set style line 1 lc rgb "red" lt 1
set style line 2 lc rgb "blue" lt 1
set style line 3 lc rgb "purple" lt 1
set style line 4 lc rgb "orange" lt 1
set style line 5 lc rgb "cyan" lt 1
set xrange [0:780]
set yrange [0:88]
set xlabel "Time (s)"
set ylabel "Temperature (°C)"
set key bottom right
plot "data.dat" using 6:1 ls 1 notitle, "data.dat" using 6:2 ls 2 notitle, "data.dat" using 6:3 ls 3 notitle, "data.dat" using 6:4 ls 4 notitle, "data.dat" using 6:5 ls 5 notitle, \
NaN ls 1 title "600 MHz", NaN ls 2 title "800 MHz", NaN ls 3 title "1100 MHz", NaN ls 4 title "1300 MHz", NaN ls 5 title "1500 MHz"
Upvotes: 1
Views: 1111
Reputation: 25694
There are different plotting styles, e.g. with points
, with lines
, with linespoints
and many others. You can also abbreviate the the styles via w p
, w l
and w lp
. Check help with
.
If you don't specify anything, the default is with points
. That's what you are getting. Setting a line style or linetype does not necessarily mean that you are plotting only a line. You also have to explicitely use with lines
.
By the way, you can use the last used file by specifying ''
. And for readability you can write multiple lines by separating with \
(note, \
must be the last character in the line, no space or others characters allowed afterwards).
Try the following:
plot "data.dat" u 6:1 w l ls 1 title "600 MHz", \
'' u 6:2 w l ls 2 title "800 MHz", \
'' u 6:3 w l ls 3 title "1100 MHz", \
'' u 6:4 w l ls 4 title "1300 MHz", \
'' u 6:5 w l ls 5 title "1500 MHz"
Upvotes: 2