gnuplot - multiple lines with different x ranges

Posted by Aly on Stack Overflow See other posts from Stack Overflow or by Aly
Published on 2010-06-11T13:22:10Z Indexed on 2010/06/16 19:02 UTC
Read the original article Hit count: 193

Filed under:

Hi, I am using gnuplot to try and plot several lines but each have different x ranges. I am running the following script:

# gnuplot script for 'omarConf2EvONLY-vs-everyone-gta-lag-lpas-omarConf1-random-tag-tpas.dat'
plot "omarConf2EvONLY-vs-everyone-gta-lag-lpas-omarConf1-random-tag-tpas.dat" using 1:2 with lines title '1'
replot "omarConf2EvONLY-vs-everyone-gta-lag-lpas-omarConf1-random-tag-tpas.dat" using 1:3 with lines title '2'
replot "omarConf2EvONLY-vs-everyone-gta-lag-lpas-omarConf1-random-tag-tpas.dat" using 1:4 with lines title '3'
replot "omarConf2EvONLY-vs-everyone-gta-lag-lpas-omarConf1-random-tag-tpas.dat" using 1:5 with lines title '4'
replot "omarConf2EvONLY-vs-everyone-gta-lag-lpas-omarConf1-random-tag-tpas.dat" using 1:6 with lines title '5'
replot "omarConf2EvONLY-vs-everyone-gta-lag-lpas-omarConf1-random-tag-tpas.dat" using 1:7 with lines title '6'
replot "omarConf2EvONLY-vs-everyone-gta-lag-lpas-omarConf1-random-tag-tpas.dat" using 1:8 with lines title '7'

set terminal png size 800,600
set output "omar_vs_everyone-EVONLY.png"
replot

and the .dat file is just a file with columns such as:

1 0.5 0.5 0.1
2 0.6 1.3 0.8
3 0.7 0.32
4 0.7 0.35
5 1.3 4.32
6 1.67

notice that the columns have different lengths as each line has different x ranges.

The problem I have is that it plots funny as shown below: alt text

© Stack Overflow or respective owner

Related posts about gnuplot