Gnuplot Title and Axis labels are cut of by half

gnuplot

Ive changed the font size of the Graph title and the x and y axis label to the double size. Now the title and axis labels are much bigger but they are cut of by half and reach into the graph itself.

Is there an option to set a margin for the title so they are plotted complete and without reaching into the graph?

// Im using gnuplot 4.6 patchlevel 0

Best Answer

The label position and the margins are calculated based on the overall terminal font size, which can be set with set terminal or set termoption font ',20'.

So if you increase the font size locally (only for the title and axes labels), the margins and the label positions are wrong.

You can set explicit margins like set lmargin 5, which reserves a left margin corresponding to 5 character widths, or even absolute margins with e.g. set lmargin at screen 0.1. For title and xlabel there is an offset option, which allows to adjust the label position relative to the default position.

set terminal pngcairo size 600,400 font ',10'
set output 'output.png'
set xlabel 'xlabel' font ',30' offset 0,-1
set bmargin 5
plot sin(x)
Related Topic