Search code examples
gnuplot

Gnuplot: removing or moving tics at the border of graph with autoscaled tics


I'm trying to add an empty boundary around the data in an autoscaled graph without having tics in the empty boundary or at the border.

$ gnuplot -p -e "set offsets 0,0,0.1,0.1; plot sin(x)" 

empty boundary with tics at the border

Desired result

Tics are gone at the y-axis border/in the empty boundary tics are gone at the border


Solution

  • set offsets 0,0,0.25,0.25
    set yrange noextend
    plot sin(x)
    

    enter image description here

    There is also the possibility to approach this quite differently, which may or may not be appropriate for your case.

    set border 2
    set ytics rangelimited
    set xtics axis
    set tics nomirror
    set xzeroaxis
    set offsets 0.,0.,.25,.25
    plot sin(x)
    

    enter image description here