Gnuplot - putting fractions in the axis label

I have a log-log chart counting with a force of 2 from 1/32.

How can I make axis labels <1 appear as fractions rather than decimal numbers (e.g. 1/32 instead of 0.03125)?

+4
source share
1 answer

You will need to manually mark the tics manually:

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

or automatically:

set logsc x; set xr [1./32:1]
set xtics 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
+4
source

All Articles