【发布时间】:2019-03-11 14:33:29
【问题描述】:
我想在 y 轴上应用对数刻度,抽动 10、1、0.1、0.01、0.001、0.0001 和 0.00001(不带尾随零)。您能帮我如何将这种格式提供给我的 GNUplot 脚本吗?
【问题讨论】:
标签: gnuplot axis-labels
我想在 y 轴上应用对数刻度,抽动 10、1、0.1、0.01、0.001、0.0001 和 0.00001(不带尾随零)。您能帮我如何将这种格式提供给我的 GNUplot 脚本吗?
【问题讨论】:
标签: gnuplot axis-labels
使用xtics、ytics 等格式,您可以添加或替换轴上的任何刻度标签。
set logscale y
set format y '%g'
set ytics add ('.00001' 0.00001, '.0001' 0.0001, '.001' 0.001, '.01' 0.01, '.1' 0.1)
【讨论】:
除了@Michael O. 的解决方案之外的另一种解决方案:
### custom tics
reset session
set logscale y
set ytics nomirror
do for [n in "-10 -9 -8 -7 -6 -5 -4 -3 -2 -1"] {
set ytics add (".0000000000"[1:abs(n)]."1" 10**n)
}
set logscale y2
set format y2 "10^{%T}"
set y2tics 10 nomirror
set xrange[-10:3]
plot 10**x axis x1y1, 10**x axis x1y2
### end of code
顺便说一句,如果你想去掉前导零只是因为节省空间,10^{%T} 格式会更节省空间(见右轴)。
【讨论】: