This problem has to do with how gnuplot handles integers when doing arithmetic. When you have an expression like 1/(90000 + R)
, if R
is an integer, gnuplot evaluates 1/(690000) = 0
, which is perfectly valid integer arithmetic. The solution is to add a period to a number so that gnuplot knows to cast it as a floating-point number:
R = 600000. # short option
R = 600000.0 # clearer option
Another solution is to use e-notation for big numbers:
R = 6e5
Gnuplot treats that as a float. This also helps prevent order-of-magnitude/number-of-zeroes errors.
Incidentally, python and other languages have the same problem with integer arithmetic--watch out!