0

There is a great question about bar charts in gnuplot.

How do you plot bar charts in gnuplot?

What is missing (and what I'm asking about) is a staggered bar chart. The example in the other question giving the bars side-by-side. The staggered bars there are additive. I want to have the bar in front of (or superimposed of) each other.

Let's say I have data:

10 20
30 50
60 80
10 50 
 0 20

I want 5 vertical bars. The first one bottom 10 units are red, the next 10 units are blue. The next bar to The right has 30 units red on bottom and 20 units blue on top. Etc.

Thanks, Gert

Community
  • 1
  • 1
Gert Gottschalk
  • 1,658
  • 3
  • 25
  • 37

1 Answers1

0

Does this do what you want (I wasn't sure I understood what you were aiming for)?:

set style data histogram set style fill solid border -1 plot 'gert' u 1 lc 'red', '' u ($2 - $1) lc 'blue' enter image description here

Lee Phillips
  • 1,168
  • 8
  • 12