Search code examples
gnuplot

How to move and manage overlapping of x ticks with axis in Gnuplot


I am trying to plot an inlet graph which is shown in Figure. Being an inlet graph it is needed to show x tics and y ticks of relatively big sizes for clear visibility. But when I increase the fonts as, set xtics font ", 40" tics overlaps with axis. I increased the plot size set term png size 1000, 1000 but still the issue persists. Kindly suggest if there is a way to move the tics below or to a desired position in graph.

Edit:

The gnuplot script looks like this,

set term png size 1000, 1000
set output "b_vs_N.png"
set style fill solid
set style circle radius 0.001
FIT_LIMIT=1.e-14


set yrange [0.15:0.25]
set style fill solid
set style circle radius 0.001
set xtics 10
set ytics 0.03

set border 15 back lw 6
set xtics font ", 40"
set ytics font ", 22"
set ylabel "b" enhanced font "1 {,40}"
set xlabel "N_i" font "1 {,40}"
set lmargin 12
set bmargin 4

set palette model HSV 
set palette rgb 3,2,2 
set palette maxcolors 12 
set view map

AA(x)=a+b*x+c*x**2
fit AA(x) "data.txt" using 1:2 via c, b, a

plot "data.txt" using 1:2 lt 1 pt 11 ps 2.0 lc rgb "black" notitle, AA(x) w lines lw 2 lc rgb "sienna1" notitle

enter image description here


Solution

  • Your example is uncomplete without code and therefore difficult to reproduce. Please check help xtics. There is the option offset.

    Maybe the following example helps to solve your issue. In the example below no special offset seems to be necessary, i.e. offset 0,0, but you can shift and adjust the labels in x and y direction.

    Code:

    ### tic label offset
    reset session
    
    set multiplot
    
        plot sin(x)/x
        
        set origin 0.07, 0.6
        set size   0.3,0.3
        set xrange [0:10]
        set xtics 5 out font ",20" offset 0,0
        plot x**2
        
    unset multiplot
    ### end of code
    

    Result:

    enter image description here