nevermind
nevermind

Reputation: 125

Ignore last zeros after . with set format in Gnuplot

I use:

set format x set format x "%2.3f"

so that (for example) number 10.55555555 comes out as 10.555.

But at the same time, I would like that (for example) number 10.000000 comes out as 10, not as 10.000.

Is that possible? To tell gnuplot to use set format x set format x "%2.3f" but to ignore zeros?

Upvotes: 1

Views: 881

Answers (1)

ewcz
ewcz

Reputation: 13097

I don't think one can achieve this solely with set format. However, you could redefine the tic corresponding to position 10. For example:

set xr [0:20]
set format x "%.3f"
set xtics add ("10" 10)
plot x

Upvotes: 2

Related Questions