As I understood "unset warnings" should suppress warnings. But it looks like this is not working with gnuplot 6.0.4
Here is my example:
$ cat HitsGame_Uzbekistan.gp
unset warnings
set encoding utf8
set title "Top 50 user race for longest hit kilometers - Uzbekistan - chart generated at 2026-03-11 02:02:54"
set terminal pngcairo size 1400,400 enhanced truecolor font 'LiberationSans-Regular,9' background rgb "#f0f0f0"
set auto x
unset xtics
set output "HitsGame_Uzbekistan.png"
set xtics nomirror rotate by -45 scale 0
set style data histogram
set style fill solid border -1
set datafile separator ','
set key box
set grid ytics
set key width 1
plot 'HitsGame_Uzbekistan.dat' u 2:xtic(1) title 'longest valid hit' lc rgb '#0000FF'
data file:
$ cat HitsGame_Uzbekistan.dat
#,longest valid hit
Laurentina,4253
Moise,4253
I still get a warning:
$ gnuplot -p HitsGame_Uzbekistan.gp
Warning: empty y range [4253:4253], adjusting to [4210.47:4295.53]
The generated bar chart is ok.
Does anyone has an idea. Or I'm just misunderstanding the "unset warnings" option?
Most, but not all, of the warnings issued by gnuplot were sent by a shared subroutine. The "unset warnings" command silences that shared mechanism. That leaves a few [a quick-and-dirty "grep" of the source tree finds about thirty] places in the source code that print the warning directly rather than going through the shared subroutine. Some of these should probably never by silenced, like the ones from the
statsandfitcommands that tell you the calculation was invalid or highly unreliable. Others, like the one you point to, could probably be changed to use the shared mechanism. Someone would have to go through the code and evaluate each site to see which case applies.I think I figured it out, here would be a patch:
Last edit: MBoehme 2026-03-13
Thanks. There's a fix already in 6.1 and queued for 6.0.next