Search code examples
gnuplot

Why gnuplot rounds data in column of vertical axis?


My old script worked fine years ago.

set terminal png background "#ffffff" enhanced fontscale 2.0 size 1800, 1400 
set output 'delete.png'
w=1
x=1  
z = 60 
y=2
plot 'plot.in.tmp' using (column(x)/z):(column(y)) axis x1y1 with lines 
exit gnuplot
reset

Now result in graph with only rounded integer points in y(vertical) axe. I dont understand why. Example data in file:

0     -0,00        0,5    570,2    11,98     -0,121      0,000        9,6 
5     -0,00        0,7    570,2    11,97     -0,002      0,012       13,2 
10     -0,00        0,9    570,3    11,98     -0,004     -0,000       16,1 
15      0,24       35,9    570,4    11,96      0,001      0,000       18,4 
20      0,56       87,0    570,1    11,99     -0,001     -0,000       20,5 
25      1,03      173,5    570,4    11,97     -0,000      0,000       23,2 
30      1,61      296,4    570,3    11,96      0,002      0,000       12,4 
35      2,17      422,6    570,2    11,68      0,004      0,000        8,8 
40      2,81      571,6    570,2    11,37      0,010      0,001        7,5 
45      3,52      752,3    570,3    11,26      0,015      0,000        7,1 
50      3,97      905,0    570,2    11,69      0,075      0,006        7,4 
55      4,36     1048,4    570,1    11,36      0,081      0,001        8,6 
60      4,59     1156,8    570,2    11,22      0,087      0,001       10,7 

Result graph:

enter image description here


Solution

  • Maybe the local setting of your system (or something in gnuplot) has changed? The following works for me with your data.

    Add a line

    set decimalsign locale "german"
    

    or

    set decimalsign locale "french"
    

    Check help decimalsign.

    Syntax: 
    
          set decimalsign {<value> | locale {"<locale>"}}
    

    Correct typesetting in most European countries requires:

      set decimalsign ','
    

    Please note: If you set an explicit string, this affects only numbers that are printed using gnuplot's gprintf() formatting routine, including axis tics. It does not affect the format expected for input data, and it does not affect numbers printed with the sprintf() formatting routine.