Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This seems to work:</p> <pre><code>set style fill solid 0.5 noborder set style histogram columnstacked set style data histogram set ylabel "Time (mins)" plot "test.dat" u 2 notitle with histogram </code></pre> <p>If you want to have a key with the colors-labels in it:</p> <pre><code>set style histogram columnstacked set style data histogram set style fill solid 0.5 noborder set ylabel "Time (mins)" plot "test.dat" u 2:key(1) with histogram </code></pre> <hr> <p>After reading your edit and playing around a bit, this is still possible, but I needed to modify your datafile. (I hope that's Ok):</p> <pre><code>"Execution" 500 "foo" NaN "Overhead 1" 200 "Overhead 2" 75 </code></pre> <p>Now the plotting script:</p> <pre><code>set style histogram columnstacked set style data histogram set style fill solid 0.5 noborder set ylabel "Time (mins)" plot for [i=0:1] "test.dat" index i u ($2):key(1) with histogram </code></pre> <p>There are a bunch of subtleties here. The pair of blank records is a way to create a separate "index" for gnuplot to use when plotting. The first bar is by itself in a dataset. Here's the problem, Gnuplot will match the first record from index 0 with the first record from index 1 and plot them with the same color. That's ugly. So we need to insert a fake record in the index=1 dataset which won't make any plot, but will take up a color. That's what the <code>"foo" NaN</code> line is designed to do. I also needed to modify the <code>plot</code> line to plot both of the indexes. And the using specification needs to change from <code>2:key(1)</code> to <code>($2):key(1)</code> as there is a slight difference in how the two forms handle missing data.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload