gnuplot rowstacked histogram: how to put sum above bars

左心房为你撑大大i 提交于 2019-12-05 23:44:23

You must give an explicit string as label:

 plot newhistogram 'foo', 'file.dat' u 2:xtic(1) t col, '' u 3 t col, \
'' u ($0-1):($2+$3):(sprintf('%.1f', $2+$3)) notitle w labels offset 0,1 font "Arial,8"

As other improvement, I would use the offset option which allows you to give an displacement in character units, which doesn't depend on the yrange.

(Side note: if a value from a column is used, then one can skip the explicit formatting of the label, like using 1:2:2 with labels, but in general one should use sprintf to format the label)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!