Search code examples
gnuplot

gnuplot does not typeset the y-label


I use gnuplot 5.4.5 for processing the following script:

set key enhanced font "Monospaced,13"
set grid

set style line 1 \
    linecolor rgb '#a82828' \
    linetype 1 linewidth 3 \
    pointtype 5 pointsize 1.0

set xlabel "Entropy"
set xrange [-0.05:1.05]
set ylabel "Amortized work"

set terminal png enhanced font "Monospaced,13" size 500,350
set output 'EntropyToAmortizedWork.png'

plot 'EntropyToAmortizedWork.dat' with linespoints linestyle 1 notitle

replot
exit

The file EntropyToAmortizedWork.dat lives here.

All in all, I get:

Missing ylabel

Clearly, we have a typesetting artifact. How could I deal with it?


Solution

  • I can reproduce this on Win10 with gnuplot 5.4.5 and terminal png, but not with gnuplot 5.4.4. Even terminal pngcairo seems to have a problem with 5.4.5, check the missing horizontal lines on some xticlabels.

    So, suggested solution would be to go back to gnuplot 5.4.4 or earlier versions.

    This would be a minimal script (no need for data).

    Script:

    ### wrong ylabel with 5.4.5 and png terminal
    reset session
    
    set ylabel "This is the y-label"
    
    set term png size 640,384
    set output "SO74179232_png.png"
    plot x
    
    set term pngcairo size 640,384
    set output "SO74179232_pngcairo.png"
    plot x
    
    set output
    ### end of script
    

    Results:

    gnuplot 5.4.5, terminal png

    enter image description here

    gnuplot 5.4.5, terminal pngcairo

    enter image description here

    gnuplot 5.4.4, terminal png

    enter image description here

    gnuplot 5.4.4, terminal pngcairo

    enter image description here