【问题标题】:How to control tic marks and their values in gnuplot tics如何在 gnuplot tic 中控制 tic 标记及其值
【发布时间】:2021-10-22 23:42:20
【问题描述】:

我的情节有 logx 轴。所以我想显示tic标记。但由于 tic 值的大小,它们重叠。例如:

但是如果我通过命令减少tic标记

设置 xtics (1.0e-7,1.0e-5, 5.0e-4);

变成

我想要那些对数抽动(如第一张图片)但只写入三个值(如第二张图片)而不影响大小。有可能吗?

【问题讨论】:

    标签: plot gnuplot gnu xticks


    【解决方案1】:

    据我了解,您基本上希望保留所有自动 tic 和网格线,但删除 1e-61e-4 tic 标签并添加 5e-4 tic 标签。

    您可以通过以下方式进行操作。检查help xticshelp format specifiers

    代码:

    ### set custom tics
    reset session
    
    set xrang[1e-7:5e-4]
    set logscale x
    set grid x,y
    set format x "%.0t x 10^{%T}"
    set rmargin 5
    
    set xtics add ('' 1e-6, '' 1e-4, 5e-4)
    plot x
    ### end of code
    

    结果:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-05
      相关资源
      最近更新 更多