2
votes

I'm trying to plot two different sets of data on the same graph using gnuplot. The first set must be plotted as boxerrorbars, and the second one as linespoints. But, when I run the code bellow on gnuplot I get the following error:

"/home/flav/salaak/src/www/plots/signature.ranking.1.EnergyPKG.gnu", line 20: warning: Skipping data file with no valid points

plot '//home/flav/salaak/src/www/plots/ranking.1.EnergyPKG.dat' using 0:2:3:xtic(1) with boxerrorbars fc rgb 'forest-green' title 'EnergyPKG [W]' axes x1y1, '//home/flav/salaak/src/www/plots/ranking.1.EnergyPKG.dsz.dat' u 1:2 w linespoints t 'Data Size bytes' axes x1y2
                                                                                                                                                                                                                                                                             ^
"/home/flav/salaak/src/www/plots/signature.ranking.1.EnergyPKG.gnu", line 20: all points y2 value undefined!

The code:

     set terminal pngcairo enhanced font 'arial,10' fontscale 1.5 size 1024, 768
      set output '/home/flav/salaak/src/www/plots/signature.ranking.1.EnergyPKG.png'
        unset border
        set grid
        set style fill  solid 0.25 noborder
        set boxwidth 0.5 absolute
        set title 'Ranking 1 '
        set xlabel  'Query.Job'
        set ylabel  'EnergyPKG [W]'
        set style histogram errorbars gap 2 lw 1
        set style data histograms
        set xrange [-0.5:3]
        set yrange [0:]
        set key under autotitle nobox
        set ytics nomirror
        set y2tics nomirror
        set y2range [0:]
        set y2label 'Data Size [bytes]' 
        plot '//home/flav/salaak/src/www/plots/ranking.1.EnergyPKG.dat' using 0:2:3:xtic(1) with boxerrorbars fc rgb 'forest-green' title 'EnergyPKG [W]' axes x1y1, \
'//home/flav/salaak/src/www/plots/ranking.1.EnergyPKG.dsz.dat' u 1:2 w linespoints t 'Data Size bytes' axes x1y2

ranking.1.EnergyPKG.dat:

q22.2   23.0008220833333    0.237935519166793
q16.2   22.988090297619 1.18050606267611
q07.4   10.6937465361916    0

ranking.1.EnergyPKG.dsz.dat:

q22.2   23359824
q16.2   1987871
q07.4   38

I can't figure out where the problem really is.

1

1 Answers

2
votes

The values in the first column aren't valid numerical values, you must use the zeroth column also when plotting the linespoints (as you already do for the boxes):

dir ='/home/flav/salaak/src/www/plots/'
plot dir.'ranking.1.EnergyPKG.dat' using 0:2:3:xtic(1) with boxerrorbars axes x1y1,\
dir.'ranking.1.EnergyPKG.dsz.dat' u 0:2 w lp axes x1y2

And, please restrict the script you post to a bare minimum, which however still shows the problem. All those ranges, labels, tic settings etc are superfluous and make it more difficult to identify the problem.