gnuplot - 将分数放入轴标签

gnuplot - putting fractions into axis label

我有一个双对数图,从 1/32 开始计算 2 的幂。

如何使轴标签 < 1 显示为分数而不是小数(例如 1/32 而不是 0.03125)?

您必须手动单独标记抽动:

set xtics ("1/2" .5, "1/4" 0.25, "1/8" .125, ...)

或自动:

set logsc x; set xr [1./32:1]
set xtics ("1",1) # remove all tics and set one initial tic
do for [i=1:5] {set xtics add (sprintf("1/%.f",2**i) 1./2**i)}
plot x