Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gnuplot--fill the space between two functions

Tags:

gnuplot

I have two functions, like:

f(x)=2**x
g(x)=1024

how can I use gnuplot to plot these two functions for x from 0 to 10 and fill the space between them?

like image 288
windy Avatar asked Nov 15 '12 08:11

windy


1 Answers

Unfortunatly gnuplot does not offer this kind of feature for functions and only for data sets. There are two ways to do this now, one of which I would recommend:

f(x)=2**x
g(x)=1024
xmax=10
set xrange [0:xmax]
plot '+' using 1:(f($1)):(g($1)) with filledcurves closed
like image 172
toxicate20 Avatar answered Oct 17 '22 14:10

toxicate20