1
votes

I am using the following gnuplot script in order to plot a dataset composed of 400 lines

set title "Learning time for the proposed approachs (Freebase)"
set term png
set boxwidth 3
set style fill solid

set output "dbpedia.png"

set ylabel "Learning time (seconds)"
set xlabel "increasing size of the training dataset"
set xtics font ", 9"
set grid

everyfifth(col) = (int(column(col))%10 ==0)?stringcolumn(1):""
plot for [col=2:4] "dbpedia_duration.txt" every 10 using col:xticlabels(everyfifth(0)) with lines lw 2 title columnheader

Sample dataset

size DDS-rand DDS-ambig DDS-ambig-NN
10 0.003 0.01 0.046
20 0.004 0.423 2.094
30 0.004 1.768 9.262
40 0.004 5.933 30.649
50 0.003 0.586 2.871
60 0.007 2.282 14.226
70 0.005 0.512 2.707
80 0.007 0.089 0.468
90 0.006 4.61 24.471
100 0.006 3.013 16.411
110 0.006 1.578 8.244
120 0.006 1.194 6.418
130 0.008 2.401 12.398
140 0.008 0.014 0.027
150 0.007 0.284 1.541
160 0.009 1.25 7.598
170 0.012 2.027 11.149

enter image description here


Problem and questions

As you can see there is a big difference between the blue curve on one side and the red and green curves on the other side. It's hard to see the other curves on a black and white paper.

Is there a better way to plot this dataset? It is really annoying because we can barely see the red and green curves.


update

if we use the set logscale y as suggested by @Daniel we do get a clear graph.

enter image description here

1

1 Answers

3
votes

A standard approach would be to plot the y axis logarithmically, such that the tics for 0.001, 0.01, 0.1, 1, 10, ... are equidistant.

set logscale y

Note: this does not work if your data set contains values exactly equal to zero. In this case, you could use

plot 'data.txt' using 1:($2>0? $2 : 1/0)

to skip values with y == zero (1/0 = undefined, which will be skipped by gnuplot). Adjust column numbers for x and y for your data file.