2
votes

I'm trying to fill the area between the curve and the axis with the following command in gnuplot:

plot 1/x w filledcurves above x1=0 t "", x t "y=x"

However the area between the curve and x axis is not fully filled(I'm not able to post an image). I did some research but find nothing. Any one can help? Thanks very much!

1

1 Answers

2
votes

If you want to fill the area between the curve and the x-axis you must use above y1=0. This is a bit counter intuitive and also took me a while to find out.

plot 1/x w filledcurves above y1=0 t "", x t "y=x"

above x1 means above the x1-axis (i.e. the lower horizontal plot border), and above x1=0 means above a vertical line with the value x=0.

enter image description here