Clear one or more previously defined user variables. This is useful in order to reset the state of a script containing an initialization test.

A variable name can contain the wildcard character * as last character. If the wildcard character is found, all variables with names that begin with the prefix preceding the wildcard will be removed. This is useful to remove several variables sharing a common prefix. Note that the wildcard character is only allowed at the end of the variable name! Specifying the wildcard character as sole argument to undefine has no effect.


undefine foo foo1 foo2
if (!exists("foo")) load "initialize.gp"
bar = 1; bar1 = 2; bar2 = 3
undefine bar*                 # removes all three variables

Copyright 1986 - 1993, 1998, 2004 Thomas Williams, Colin Kelley
Distributed under the gnuplot license (rights to distribute modified versions are withheld).