在Gnuplot中关闭科学计数法 [英] Turn Off Scientific Notation In Gnuplot

查看:269
本文介绍了在Gnuplot中关闭科学计数法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在gnuplot中,我为y轴启用了对数缩放,这使我从11,000,000.但是,1,000,000勾号会以科学计数法出现.因为它是该格式中唯一的数字,所以它脱颖而出.我想将其编写为1000000.我所有的Google搜索都禁用科学计数法,将其设置为小数点格式或扩大ytics空间并没有产生解决我的问题的任何方法.

In gnuplot I've enabled logscale for my y axis, which gives me 1 to 1,000,000. However, the 1,000,000 tick appears in scientific notation. That stands out since its the only number in that form. I'd like to have it written as 1000000. All of my Google searches for disabling scientific notation, formatting as a decimal, or making the ytics space wider haven't produced anything that solves my problem.

推荐答案

可以使用set format xset xtics format设置轴tic的格式(yzx2的等效命令, y2cb也存在).

The format of the axis tics is set either with set format x or set xtics format (equivalent commands for y, z, x2, y2 and cb exists as well).

使用show format进行查找,这是默认格式(结果为4.6.6,因为5.0,默认值为% h)

Use show format to find out, which is the default format (result for 4.6.6, since 5.0 the default is % h)

gnuplot> show format
    tic format is: 
      x-axis: "% g"
      ...

%g是gnuplot特定的格式说明符,但与用于sprintf的C格式说明符和类似功能相似.根据gnuplot文档,%g的定义是:"%e%f中的较短者".这就是为什么格式可以在单个轴上更改的原因.

%g is a gnuplot-specific format specifier, but works similar to the C format specifiers used for sprintf and similar functions. The definition of %g according to the gnuplot documentation is: "the shorter of %e and %f". This is why the format can change for a single axis.

因此,最后,要更改所有抽签的固定格式,请使用例如

So, finally, to change to a fixed format for all tics, use e.g.

set format y '%.0f'

这篇关于在Gnuplot中关闭科学计数法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆