0

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

theozh
  • 22,244
  • 5
  • 28
  • 72
M E
  • 3
  • 1

2 Answers2

1

Welcome to StackOverflow! 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.

theozh
  • 22,244
  • 5
  • 28
  • 72
  • thanks, but it is not affect to input data. It seems cannot be resolved in gnuplot. I replace , to . in data for resolve problem. – M E Mar 05 '22 at 16:44
  • @ME well, you can change your data... that's one way. But `set decimalsign locale "german"` or other countries which are using comma as decimal separator will tell gnuplot to interpret comma as decimal separator. At least it works on my gnuplot and I don't see a reason why it shouldn't work on your gnuplot. Which version of gnuplot are you running and which country/language settings do you have? – theozh Mar 07 '22 at 11:36
  • found it worked in terminal by command. – M E Mar 08 '22 at 17:59
  • it seems i misprinted in my code before, now i got it worked. thanks. I was changed decimal sign in windows regional settings in sometime. – M E Mar 08 '22 at 18:53
0

The answer given by theozh is correct, but it does not point out the unfortunate lack of standardization about how different operating systems report the current locale setting. For linux machines the locale strings are less human-friendly. For example instead of using something generic like "french", they subdivide into "fr_FR.UTF-8" "fr_BE.UTF-8" "fr_LU.UTF-8" etc to account for slight differences in the conventions used in France, Belgium, Luxembourg, etc.

I cannot tell you the exact set of locale descriptions on your machine, but here is what works for me on a linux machine:

set decimalsign locale "fr_FR.UTF-8"
w=1
x=1  
z = 60 
y=2
plot 'plot.in.tmp' using (column(x)/z):(column(y)) axis x1y1 with lines 

enter image description here

Ethan
  • 13,715
  • 2
  • 12
  • 21