Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

filling under step functions in gnuplot

Tags:

plot

fill

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?

like image 293
Hamed Avatar asked Aug 25 '15 20:08

Hamed


1 Answers

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

like image 166
Christoph Avatar answered Oct 31 '22 10:10

Christoph