Search code examples
plotgnuplot

gnuplot, hide default xtics, add xtics


I am trying to remove the xtics from a plot (text labels and small vertical lines) and replace with my own customized xtics (labels vertical lines). I could add text labels and arrows without heads instead of xtics (http://gnuplot.sourceforge.net/demo/textrotate.html), but there has to be a simpler solution.

I tried this:

unset xtics
set xtics format ""
set xtics scale 0
set xtics add ("someTicLabel1" someFloat1)
set xtics add ("someTicLabel2" someFloat2)

It gets rid of the default xtics labels, but the xtic vertical lines remain. How do I get rid of them?


Solution

  • I read a solution to a similar problem (gnuplot: keep tics, remove labels) and I realized the solution to my problem is not to use set xtics add, but set xtics:

    unset xtics
    set xtics format " "
    set xtics ("someTicLabel1" someFloat1, "someTicLabel2" someFloat2)
    

    Problem solved. Thanks.