Prevent existing execution due to obtaining "NaN" result from Gnuplot's fit command
<p>My <code>gnuplot</code> script contains series of fitting:</p>

<pre><code>...
fit f(x) "$data" via a, r
...
fit f(x) "$data" via a, r
...
fit f(x) "$data" via a, r
...
</code></pre>

<p>which I wish it to run till the end of the script but sometimes, when the <code>fit</code> command return <code>"NaN"</code> result with error message:</p>

<pre><code>Function evaluation yields NaN ("not a number")
</code></pre>

<p>The program will be dead and the rest of lines will never be executed. My question is how to handle this problem nicely?</p>