Hamed
Hamed

Reputation: 574

filling under step functions in gnuplot

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?

Upvotes: 7

Views: 3337

Answers (1)

Christoph
Christoph

Reputation: 48430

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

Upvotes: 7

Related Questions