设置gnuplot数据标签的精度

问题描述

我想绘制数据标签以及箱形图:

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

$3的精确度为 8 个十进制值,但是我只想打印 3 个小数位。

我已经尝试使用floor函数,但是它不起作用:

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

解决方法

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