histogram - GNUPLOT - Can't display values over the bar -


i'm trying make simple histogram file '.dat'

moment "energy consumed (mwh)" "apr-16" 2011.4 "may-16" 1869.6 "jun-16" 1899.0 "jul-16" 1659.0 "aug-16" 1740.6 "sep-16" 1670.0 

for purpose have written following script

  #!/usr/bin/gnuplot   set term postscript   set terminal pngcairo nocrop enhanced size 700,700 font "arial,18"   set termoption dash   set output out   set boxwidth 0.5 absolute   set border 0   set style fill   solid 1.00 border lt -1   set key off   set style histogram clustered gap 1 title textcolor lt -1   set datafile missing '-'   set style data histograms   set xtics border in scale 0,0 nomirror autojustify   set xtics  norangelimit   set xtics ()   unset ytics   set title titulo   set yrange [0.0000 : limite] noreverse nowriteback    show style line   set style line 1 lt 1 lc rgb color lw 1    ## last datafile plotted: "immigration.dat"   plot fuente using (column(0)):2:xtic(1) title titulo ls 1 boxes, '' using 0:2:2 labels 

in case out output filename, titulo label appears on top of image output, limite value use biggest value on y-axi, , fuente source filename.

the result this

enter image description here

i trying display values on bar offset because need values on bars , not inside bars. need separate trying code like:

plot fuente using (column(0)):2:xtic(1) title titulo ls 1 boxes, '' using 0:($2 + 0.5):2 labels 

because have seen many sites doing $2 + 0.5 doesn't work me.

what should do? please me completly lost. in advance.

use offset parameter with labels plotting styles. can add vertical offset specify e.g. in character or graph units:

plot fuente using 0:2:xtic(1) boxes, '' using 0:2:2 labels offset 0, char 1 

sidenote: adding constant value of 0.5 y-value (like $2 + 0.5) doesn't work you, because 0.5 in units of y-axis, , small compared yrange.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -