7

I am using Gnuplot to draw step functions from an input file:

plot 'myFile' using 1:2 with steps

I want to fill underneath the plot. something like

plot 'myFile' using 1:2 with filledcurves 

But Gnuplot fill underneath the diagram by drawing a line between consecutive points.

How can I fill in underneath the step function?

Hamed
  • 474
  • 5
  • 17

1 Answers1

7

Use the fillsteps plotting style, which is the same as steps, but the area between the curve and y=0 is filled:

set samples 11
set xrange [0:10]
plot '+' with fillsteps fs solid 0.3 noborder lt 1,\
     '+' with steps lt 1 lw 4

enter image description here

Christoph
  • 47,569
  • 8
  • 87
  • 187