Reputation: 9622
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?
Upvotes: 8
Views: 23954
Reputation: 1142
In case someone really needs to remove the ticks and not just their labels...
unset ytics
set ytics format '' scale 0
unset ytics
(xtics
etc) just restores the default ticks.
set ytics format ''
(xtics
etc) just removes the labels of default ticks.
set ytics scale 0
(xtics
etc) makes default ticks' size 0.
Btw, this still does not remove the default ticks ' gridlines, if you do set grid ytics back lt 1 lw 1 lc rgb "grey"
(xtics
etc) you will see them. Of course, there is set grid noytics
(noxtics
etc).
In other words, I have not found a way to remove the ticks, but only to make them invisible...
Upvotes: 2
Reputation: 9622
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.
Upvotes: 11