我想在轴y上使用tics 10
,1
,0.1
,0.01
,0.001
,0.0001
和0.00001
(没有尾随零)应用对数刻度。您能否请求我帮助我如何为我的GNUplot脚本提供这种格式?
使用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}
将更节省空间(见右轴)。