Gnuplot, how to add a grid without ticks?

I have something like:

set grid xtics lt 0 lw 1 lc rgb "#a9a9a9" set grid ytics lt 0 lw 1 lc rgb "#a9a9a9" 

or the same without the xtics tag, and it works great! But if I add:

 unset xtics 

Then the grid also disappears :(

How can I get only a grid without ticks?

+7
gnuplot
source share
2 answers

To hide the main ticks, you can use set tics scale 0 :

 set grid set tics scale 0 plot x 

enter image description here

Please note: if one day you also want to use small ticks and hide them, you should use set tics scale 0,0.001 .

+11
source share

If you want tic labels to disappear, use set format :

 set format x "" set format y "" set grid plot x 

enter image description here

If you also donโ€™t need ticks, then, as far as I know, you will need a more complex script, perhaps using iterators and arrows, for example, the following (you will need to change the limits depending on your xrange and yrange and the style of the arrow to your liking) :

 unset xtics unset ytics set for [i=-5:5:5] arrow from i,-10 to i,10 nohead set for [j=-5:5:5] arrow from -10,j to 10,j nohead plot x 

enter image description here

+4
source share

All Articles