|
From: Ethan A M. <sf...@us...> - 2016-01-15 17:41:28
|
On Friday, 15 January, 2016 11:38:01 pl...@pi... wrote: > Hi , > > I accidentally forgot a * operator when plotting a function. This seems > to have injected an udefined fn into the name space > > > twopi=2*pi > > gnuplot> plot datafile" u ($1/365.25+1970):2 w l, cos (twopi(x)/p3) +0.05 > undefined function: twopi > > User-Defined Functions: > cos1(x)=a1*cos(twopi*(x-phi1)/p1) > cos2(x)=a2*cos(twopi*(x-phi2)/p2) > cos3(x)=a3*cos(twopi*(x-phi3)/p3) > triple(x)=c+cos3(x) > twopi is undefined > > > gnuplot> print twopi > 6.28318530717959 > > > Now it won't stop crapping on about "twopi is undefined", even though I > have plotted something else and make no reference to it. > > > All I can find to clear it is to quit gnuplot. > > Has this , as it seems, injected an undeclared function into the name > space ? > > How to clear it more elegantly, is this a bug? There is currently no way to clear or delete any user-provided function. That is true for your well-defined functions as well as your undefined function. The "undefine FOO" command only looks for FOO as a variable name not as a function name. If you want to reset the entire namespace you can use "reset session". Of course that will clear everything, not just the undefined function. Ethan |