Note that there are some explanatory texts on larger screens.

plurals
  1. POerror while plotting stacked bar in gnuplot
    primarykey
    data
    text
    <p>I am trying to plot stacked bar graph using gnuplot. As for example I tried to plot stacked bar graph using data and gnuplot code below:</p> <p>Data is:</p> <pre><code>year foo bar rest 1900 20 10 20 2000 20 30 10 2100 20 10 10 </code></pre> <p>The gnuplot code is:</p> <pre><code># # Stacked histograms # set term png size 300,300 set output 'stackedhisto.png' #set title "Stacked histogram\nTotals" # Where to put the legend # and what it should contain set key invert reverse Left outside set key autotitle columnheader set yrange [0:100] set ylabel "total" # Define plot style 'stacked histogram' # with additional settings set style data histogram set style histogram rowstacked set style fill solid border -1 set boxwidth 0.75 # We are plotting columns 2, 3 and 4 as y-values, # the x-ticks are coming from column 1 plot 'stackedhisto.dat' using 2:xtic(1) \ ,'' using 3 \ ,'' using 4 </code></pre> <p>When I execute the above code I get some error which I dont know the source is. The error is as below:</p> <pre><code>./script-plot-total-stacked-bar.gnu: line 25: syntax error near unexpected token `(' ./script-plot-total-stacked-bar.gnu: line 25: `plot 'stackedhisto.dat' using 2:xtic(1) \' </code></pre> <p>This error preventing me from plotting my own data. I am using gnuplot 4.6 in Ubuntu 11.10. Appreciate any help in advance. Thanks</p> <p>note : In fact this is published at <a href="http://ajhaupt.blogspot.com/2010/12/gnuplot-stacked-histograms.html" rel="nofollow">1</a>.</p>
    singulars
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    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