title: How do I use the columnhead (string) in a data file on the x-axis as a xiticlabel of a plot with boxes? (Gnuplot)
body: <p>I´m new here and this is my first question, hope my Problem is described properly according to our rules in here...</p>
  
  <p>I´ve got a data file (datafile.dat) which is used to create several plots (see below):</p>
  
  <pre><code>temp name1  name2
  10   1000   1200
  22   800    750
  50   250    200
  100  80     82
  107  5      3
  </code></pre>
  
  <p>What I want to do is to create a plot with the values in the second and third column plotted with boxes. On the x-axis the names these values refer to shall be displayed. In Addition it shall be possible to give each of the boxes a specific colour. An additional Advantage would be that the solution can also be used in a Loop (because the original data file contains a lot more columns...).
  In the end I want the graph to look something like this:
  <a href="https://i.stack.imgur.com/WVold.png" rel="nofollow noreferrer">Desired Layout of the plot.</a></p>
  
  <p>In order to get this I tried different things I found searching the Internet (see below). I am running gnuplot 5 on Windows with the following command file:</p>
  
  <p><a href="https://stackoverflow.com/questions/14950726/custom-string-in-xticlabels-in-gnuplot">xticlabels</a>
  If I try this e.g. for column 2 this doesn´t work:  </p>
  
  <pre><code>plot 'datafile.dat' u 2:xticlabels(columnhead(2))
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/11211339/gnuplot-store-one-number-from-data-file-into-variable?rq=1">Using an external utility</a>
  Didn´t work at all, failure message was produced</p>
  
  <p><a href="https://stackoverflow.com/questions/18583180/gnuplot-how-to-load-and-display-single-numeric-value-from-data-file">Stats</a>
  Looks like a pretty good solution if I store the output in a variable. But I can´t get my code working (see below):</p>
  
  <pre><code>reset
  set terminal postscript eps size 15 cm, 15 cm colour enhanced dashed "Times, 22"
  set output "test.pdf"
  stats 'datafile.dat' using 2
  b = STATS_sum
  plot 'datafile.dat' u 2:xticlabels(b) every ::1     
  reset
  </code></pre>
  
  <p>What can I do to create the desired output from the data file above? I tried the Points mentioned above in many different combinations. <a href="http://quabr.com/32394606/gnuplot-set-columnheader-as-label" rel="nofollow noreferrer">Suggestion 1</a>, <a href="https://stackoverflow.com/questions/13986596/accessing-the-nth-datapoint-in-a-datafile-using-gnuplot?rq=1">Suggestion 2</a>, <a href="https://stackoverflow.com/questions/21309122/gnuplot-how-to-save-datafile-values-into-a-variable-with-condition?rq=1">Suggestion 3</a> are further Topic-related ideas to solve the Problem but I got none of these working. Can please anyone help me to get a solution? Any hints will be highly appreciated!!!</p>
  
  <p>Thanks in advance!!!</p>
  
  <p>Michael</p>
  
  <p>EDIT: I found out that this question was already asked from someone else three years ago: <a href="https://stackoverflow.com/questions/16089301/how-do-i-set-axis-label-with-column-header-in-gnuplot">Axis label and column header</a> ...Is there maybe a solution today? Also: <a href="https://stackoverflow.com/questions/32394606/gnuplot-set-columnheader-as-label?rq=1">Question</a></p>