GNUPLOT - cannot display values ​​above a panel

I am trying to make a simple histogram with this '.dat' file

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 this purpose I wrote the 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 with boxes, '' using 0:2:2 with labels

In this case out, this is the name of the output file, titulo- this is the label that appears at the top of the image, limite- this is the value that I use as the largest value for y-axi, and fuenteis the original file name.

The result is

enter image description here

I am trying to display values ​​above a row with some offset, because I need values ​​above the columns, not inside the columns. I need a separate one I'm trying with code like:

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

because I have seen many sites on which he does this $2 + 0.5, but this does not work for me.

What should I do? Please help me, I'm completely lost. Thanks in advance.

+2
1

offset with labels. , , . character graph:

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

Sidenote: 0.5 y (, $2 + 0.5) , 0.5 y yrange.

+2

All Articles