gnuplot - multiple lines with different x ranges
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 http://img192.imageshack.us/img192/4686/gnuplotfail.png
Ok Have found the answer:
must edit the dat file by placing in fullstops to pad out the data like so:
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 . .
精彩评论