Gnuplot,如何添加没有刻度的网格?

use*_*219 7 gnuplot

我有类似的东西:

set grid xtics lt 0 lw 1 lc rgb "#a9a9a9"
set grid ytics lt 0 lw 1 lc rgb "#a9a9a9"
Run Code Online (Sandbox Code Playgroud)

或者没有"xtics"标签,并且工作正常!但如果我补充:

unset xtics
Run Code Online (Sandbox Code Playgroud)

然后网格也消失了:(

我怎么才能有一个网格,没有抽搐?

Chr*_*oph 11

要隐藏主要刻度,您可以使用set tics scale 0:

set grid
set tics scale 0
plot x
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

请注意,如果有一天您还想使用次要刻度并隐藏它们,则必须使用set tics scale 0,0.001.


Mig*_*uel 6

如果您只想让抽头标签消失,请使用set format:

set format x ""
set format y ""
set grid
plot x
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

如果你不想或者抽搐,然后就我知道你需要一个更复杂的脚本,可能使用迭代器和箭头,例如下面的(你必须依赖于限制更改xrange,并yrange与箭头风格,你喜欢的):

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
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述