首页 > 解决方案 > 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

标签: gnuplot

解决方案


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

推荐阅读