Gnuplot-Xtics与网格不同

时间:2019-08-23 13:24:19

标签: gnuplot axis-labels

gnuplot网格显示在与xtics / ytics相同的位置。

如何去除某些(不是全部)抽搐的抽签标签?

在我的情况下,我想在x和y方向上每0.25绘制一条网格线(即0 | 0.25 | 0.5 | ...)。我只希望每0.5个间隔(即0 | 0.5 | 1 | 1.5 ..... p)在x方向上显示tic标签。

1 个答案:

答案 0 :(得分:2)

有几种可能性。

1)单个tic标签可以用空字符串替换:

set xtics 0.25
set xtics add ("" 0.25, "" 0.75, "" 1.25, "" 1.75)

2)对主要和次要tic网格线使用相同的线型。对其他网格线使用次要抽线:

set grid lt 2, lt 2     # same linetype for major and minor grid lines
set grid xtics mxtics   # draw grid for both major and minor tics on x
set xtics 0.5           # major tics every 0.5
set mxtics 2            # minor tics at double frequency of major tics

3)对图使用常规xtics,但对网格使用x2轴

set grid x2tics noxtics     # grid lines for x2 but not x
set link x2                 # x2 axis uses same range as x axis
set xtics 0.5               # define tics along x axis
set x2tics 0.25 format ""   # different tics along x2, no labels