【问题标题】:Gnuplot - xtics different from gridGnuplot - xtics 不同于网格
【发布时间】:2019-08-23 13:24:19
【问题描述】:

gnuplot 网格出现在与 xtics/ytics 相同的位置。

我怎样才能摆脱一些(不是全部)抽动的抽动标签?

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

【问题讨论】:

    标签: gnuplot axis-labels


    【解决方案1】:

    有几种可能。

    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
    

    【讨论】:

    • 我选择了 3),但将最后一个命令更改为 set x2tics 0.25 format "" scale 0 以隐藏 tic 标记本身。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多