1
votes

I have a problem, I believe is a bug on gnuplot.

I try to plot this

Here is the code im using

set yrange [0:1]
set xrange [0:10]
pl sqrt(1-1/x)

but fit curve start around [1:0.1] and I want to make he start at [1:0] but I cant, I know its a simple fit and i cannot find what I can do this. Only on gnuplot I got this problem, is I use chrome plot function its plot ok, and after I want to manage plot this function with external data.

I will be glad if someone could help me.

1
Believe me, 100% of the time when I though I had for sure found a bug in gnuplot, turned out it was just something I misunderstood... gnuplot is a remarquable piece of software, but quite complex to fully understand. - kebs

1 Answers

1
votes

That's only a matter of sampling. Use 101 sample points (or a high sampling rate), which includes 1 as a sampling point and you're fine:

set yrange [0:1]
set xrange [0:10]
set samples 101
pl sqrt(1-1/x)

Result with 4.6.5:

graph showing desired behaviour