Yatharth
Yatharth

Reputation: 27

Set precision for gnuplot data labels

I want to plot data labels along with my box plot:

   plot ARG2 using 1:2 with boxes lc rgb "blue" notitle,\
    "" u 1:2:3 with labels notitle

The column $3 has a precison of 8 decimal values, however I want to print only 3 decimal places.

I have tried using the floor function but it doesn't work:

"" u 1:2:(floor($3*1e3)/1e3) with labels notitle

Upvotes: 0

Views: 344

Answers (1)

Ethan
Ethan

Reputation: 15118

plot "whatever" using 1:2:(sprintf("%.3f",$3)) with labels

Upvotes: 2

Related Questions