gnuplot - 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
解决方案
plot "whatever" using 1:2:(sprintf("%.3f",$3)) with labels
推荐阅读
- mysql - Mysql 服务器意外关闭,无法连接数据库
- python - 使用 seaborn catplot 绘制堆积条形图
- python - 熊猫 groupby 总和导致空白
- java - 如何限制从 1895 年到 2021 年范围内编辑文本的输入
- python - 坚持使用 Python if-else 一行语句
- laravel - Laravel Livewire 点击提交
- javascript - 当使用javascript满足某些条件时,有没有办法停止监听事件?
- java - 为什么我的猜谜游戏没有出错但无法正常运行?
- go - 在本地机器上运行第一个 Go 项目时出错
- c++ - C++14 与 C++17 的部分专业化差异?