Turn Off Scientific Notation In Gnuplot

≯℡__Kan透↙ 提交于 2019-12-01 17:35:55

问题


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.


回答1:


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).

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 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'


来源:https://stackoverflow.com/questions/33241104/turn-off-scientific-notation-in-gnuplot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!