Search code examples
plotbordergnuplot

Gnuplot: how to only draw xtics without tic lables on top


I want to draw xtics on top but without its tic labels:

This is what I want:

enter image description here

This is the code I tried:

set xtics mirror;
set border 2+4;
plot x;

This gave me:

enter image description here

How can I modify the script to get what I want?


Solution

  • You can remove the tick labels with set format x '', but that still leaves the xtics at the bottom.

    In my opinion, the best way is to use only the x2-axis

    set ytics nomirror
    unset xtics
    set x2tics nomirror
    set format x2 ''
    set border 2+4
    plot x axes x2y1
    

    enter image description here