1
votes

I am able to create the following boxplot using gnuplot.

enter image description here

However, I want the xtic labels to be of the form log(x).

For instance, label 2 would be written as log(100), 3 as log(1000) and so on.

Is there any way I can do this?

1
Not the ideal solution, but you can place tics explicitly, see the docs - vukung
That might work. But I was hoping for the labels to be generated automatically. - abcdef

1 Answers

2
votes

You must do that manually using set xtics (...):

set xtics ('log(1)' 0, 'log(10)' 1, 'log(100)' 2, 'log(100)' 3)

to have this automated a bit, you can loop over your x-values:

set xtics ('log(1)' 0)
set for [i=1:5] xtics add (sprintf("log(%d)", 10**i) i)

Something like

set xtics format "log(...)"

doesn't work. This uses the same syntax like gprintf, which allows to extract several information of the given tic values (like mantissa, power, scientific power, hex, octal, multiple of pi etc), but not to perform mathematical operations on the values (10**(ticvalue)) and use the result for the visualization.