I am trying to add values on top of the bars of the histogram. I realised that a lot of answers are available, and I tried a few such as following this one gnuplot histogram: How to put values on top of bars. however, the result does not have any values. Could someone guide me reading this.
clear
reset
unset key
$Data <<EOD
Case Case1 Case2 Case3
Value1 33.22 71.62 76.11
Value2 29.82 34.08 28.41
EOD
set style data histogram
set style fill solid border
set style histogram clustered
plot for [COL=2:4] $Data with boxes fill pattern 1, '' u 1:($2 + 0.5):($2) with labels
set key
set yrange [0:100]
set term png
set output "histogram_demo.png"
replot
There are several problems here
histograms
and then plot instead with boxes
using
specifierFor example
$Data <<EOD
Case Case1 Case2 Case3
Value1 33.22 71.62 76.11
Value2 29.82 34.08 28.41
EOD
set key autotitle columnhead
set style data histogram
set style fill solid border
set style histogram clustered
plot for [COL=2:4] $Data using COL fill pattern 1, \
for [COL=2:4] '' u ($0 + COL*0.2 - 0.6):COL:COL with labels offset 0,1