在 Gnuplot 中关闭科学记数法
Turn Off Scientific Notation In Gnuplot
在 gnuplot 中,我为我的 y
轴启用了 logscale,这使我得到 1
到 1,000,000
。但是,1,000,000
刻度出现在科学记数法中。这很突出,因为它是该表格中唯一的数字。我想把它写成 1000000
。我所有 Google 搜索禁用科学记数法,格式化为小数,或使 ytics space 更宽都没有产生任何解决我问题的方法。
坐标轴的格式设置为 set format x
或 set xtics format
(y
、z
、x2
、[= 的等效命令17=] 和 cb
也存在)。
使用show format
找出默认格式(4.6.6的结果,因为5.0默认是% h
)
gnuplot> show format
tic format is:
x-axis: "% g"
...
%g
是特定于 gnuplot 的格式说明符,但其工作方式类似于用于 sprintf
和类似函数的 C 格式说明符。根据 gnuplot 文档 %g
的定义是:"the shorter of %e
and %f
"。这就是格式可以针对单个轴更改的原因。
所以,最后,要为所有 tics 更改为固定格式,请使用例如
set format y '%.0f'
在 gnuplot 中,我为我的 y
轴启用了 logscale,这使我得到 1
到 1,000,000
。但是,1,000,000
刻度出现在科学记数法中。这很突出,因为它是该表格中唯一的数字。我想把它写成 1000000
。我所有 Google 搜索禁用科学记数法,格式化为小数,或使 ytics space 更宽都没有产生任何解决我问题的方法。
坐标轴的格式设置为 set format x
或 set xtics format
(y
、z
、x2
、[= 的等效命令17=] 和 cb
也存在)。
使用show format
找出默认格式(4.6.6的结果,因为5.0默认是% h
)
gnuplot> show format
tic format is:
x-axis: "% g"
...
%g
是特定于 gnuplot 的格式说明符,但其工作方式类似于用于 sprintf
和类似函数的 C 格式说明符。根据 gnuplot 文档 %g
的定义是:"the shorter of %e
and %f
"。这就是格式可以针对单个轴更改的原因。
所以,最后,要为所有 tics 更改为固定格式,请使用例如
set format y '%.0f'