title: Gnuplot bar chart with personalize interval on x-axis
body: <p>I'm new using gnuplot and i would like to replicate this plot: <a href="https://images.app.goo.gl/DqygL2gfk3jZ7jsK6" rel="nofollow noreferrer">https://images.app.goo.gl/DqygL2gfk3jZ7jsK6</a></p>
  <p>I have a file.dat with continuous value between 0 and 100 and i would like to plot it, subdivided in intervals ( pident&gt; 98, 90 &lt; pident &lt; 100...) Etc. And on y-axis the total occurrences.</p>
  <p>I looked everywhere finding a way but still I cannot do it.</p>
  <p>Thank you !
  sample of the data, with the value and the counts:</p>
  <pre><code>33.18 5
  43.296 1
  33.19 1
  27.168 5
  71.429 11
  30.698 9
  47.934 1
  43.299 3
  30.699 3
  37.092 2
  24.492 2
  24.493 2
  24.494 7
  47.938 1
  24.497 1
  37.097 8
  37.099 2
  33.824 7
  51.111 15
  59.025 2
  62.553 2
  62.554 2
  57.867 2
  33.826 2
  62.555 1
  33.827 5
  62.556 2
  33.828 1
  59.028 1
  46.429 11
  51.117 1
  75.158 2
  27.621 1
  27.623 1
  27.624 2
  37.5 113
  37.6 2
  32.313 8
  27.626 3
  37.7 3
  32.314 1
  67.797 3
  27.628 2
  32.316 2
  37.9 1
  61.044 1
  43.81 5
  32.317 8
  32.318 2
  43.82 4
  32.319 2
  43.83 2
  37.551 3
  61.048 1
  48.993 6
  29.43 2
  </code></pre>
  <p>This is the code tried so far (where i also calculate the mean):</p>
  <pre><code>#!/usr/bin/gnuplot -persist
  set noytics
  
  # Find the mean
  mean= system(&quot;awk '{sum+=$1*$2; tot+=$2} END{print sum/tot}' hist.dat&quot;)
  
  set arrow 1 from mean,0 to mean, graph 1 nohead ls 1 lc rgb &quot;blue&quot;
  set label 1 sprintf(&quot; Mean: %s&quot;, mean) at mean, screen 0.1
  
  # Histogram
  binwidth=10
  bin(x,width)=width*floor(x/width)
  plot 'hist.dat' using (bin($1,binwidth)):(1.0) smooth freq with boxes
  </code></pre>
  <p>This is the result:
  <a href="https://i.stack.imgur.com/xBcd6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xBcd6.png" alt="enter image description here" /></a></p>