Search code examples
plotgnuplotmultiple-axes

Gnuplot xtic label alignment adjustments


I am trying to make a multiplot graph for the following data:

col,   col1 , col2, col3
20,    4.9, 17.1, 78.1 
25,    4.0, 22.0, 74.0 
30,    2.0, 17.0, 81.0 
35,   11.5, 21.7, 66.8 
40,    4.7, 18.0, 77.4 
45,    3.8,  8.9, 87.3 
50,    0.6, 17.3, 82.1 
55,    2.0,  3.4, 94.6 
60,    1.0,  1.3, 97.6 

Using the Gnuplot script

set terminal pngcairo
set output "num.png"
set style data histogram
set style histogram rowstacked
set style fill solid
set key outside
set boxwidth 0.5

set size 1,1
set origin 0,0

set datafile separator ","
set multiplot layout 4,1 
set size 1,0.25
set origin 0,0.25
set xtics border font ",6"
set lmargin at screen 0.1
set tmargin at screen 0.25
set bmargin at screen 0.1
set rmargin at screen 1
plot for [COL=2:4] 'num.bat' using COL:xtic(1) ti col
unset multiplot
exit

I got the following image.

Multiplot Image

I like to have the x-axis labels 20, 25, 30,.... closer to the x-axis. How much ever I try it is staying far away from it. Can someone please suggest the solution for this.


Solution

  • Check help xtics... And add for example

    set xtics offset 0,0.5