【问题标题】:Can gnuplot use non-normalised scientific notation to label axis ticks?gnuplot 可以使用非标准化科学记数法来标记轴刻度吗?
【发布时间】:2015-06-19 23:36:40
【问题描述】:

我有一个由 Gnuplot 4.4 在 Centos 6.6 上生成的图,它的 Y 轴具有自动生成的刻度,带有以下标签:

1.9e-05
1.8e-05
1.7e-05
1.6e-05
1.5e-05
1.4e-05
1.3e-05
1.2e-05
1.1e-05
  1e-05
  9e-06

是否可以在 gnuplot 脚本中请求轴具有一致的指数?像这样:

19e-06
18e-06
17e-06
16e-06
15e-06
14e-06
13e-06
12e-06
11e-06
10e-06
 9e-06

我认为这会使这些值更容易一目了然地阅读和理解。

我确实意识到科学记数法通常是normalised,因此系数位于[0,1] 范围内。我想关掉它。

【问题讨论】:

    标签: gnuplot scientific-notation


    【解决方案1】:

    Gnuplot 无法自动执行此操作。您需要选择所需的指数,适当缩放数据并手动将指数添加到格式中:

    exponent = -6
    set format y '%.0f'.sprintf('e%d', exponent)
    scale = 10**(-exponent)
    plot 'data.dat' using 1:($2*scale)
    

    编辑:对于您的具体示例,您可以使用 gnuplots 来使用科学能力(三的倍数):

    set terminal pngcairo enhanced font 'DejaVu Sans'
    set encoding utf8
    set format y '%.0s✕10^{%S}'
    set xrange [9:19]
    plot 1e-6*x
    

    请注意,此处仅对乘号 ✕ (U+2715) 需要 utf8 编码。 gnuplot 4.4.4 的输出是

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-10-02
      • 1970-01-01
      • 2012-03-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-07
      • 2020-06-26
      相关资源
      最近更新 更多