Setting the size of title in gnuplot

Viewed 88

I have the following script to place in a bash script:

    #!/bin/bash
    set -e
gnuplot -persist <<-EOFMarker
    set pixmap 1 "pathToimage/fig.png" at screen 0.85, 0 width screen 0.15 behind
    set rmargin at screen 0.85

    # Border line definition
    set border lw 1

    # Major and Minor grid definition
    set style line 100 lt 1 lc rgb "gray" lw 2
    set style line 101 lt 0.5 lc rgb "gray" lw 1
    set grid mytics ytics ls 100, ls 101
    set grid mxtics xtics ls 100, ls 101

    set title 'myTitle' font ", 30"
    set ylabel 'y [m]' font "Helvetica, 12"
    set xlabel 'x [m]' font "Helvetica, 12"
    set tics font "Helvetica,10"


    plot [-10:10] sin(x),atan(x),cos(atan(x))
EOFMarker

The script is intended to do some plotting and place a logo on the corner of the plot. However, I am not able to change the size of the fonts... I am using gnuplot 5.4.3.

Any advice?

1 Answers

Have you tried to set a terminal? Maybe your default terminal does not support changing the title size.

Using this script, I can set the title size:

set pixmap 1 "linux.png" at screen 0.85, 0 width screen 0.15 behind
set rmargin at screen 0.85

# Border line definition
set border lw 1

# Major and Minor grid definition
set style line 100 lt 1 lc rgb "gray" lw 2
set style line 101 lt 0.5 lc rgb "gray" lw 1
set grid mytics ytics ls 100, ls 101
set grid mxtics xtics ls 100, ls 101

set term png  # new
set o "output.png"  # new
set title 'myTitle' font ", 30"
set ylabel 'y [m]' font ", 12"  # removed font spec
set xlabel 'x [m]' font ", 12"  # removed font spec
set tics font ",10"
plot [-10:10] sin(x),atan(x),cos(atan(x))
set o

The output is

Large title

If I set the font size to 12, I get normal title

Related