fplot2d(x, fun) is a weak duplicate of plot(x, fun) and should be removed
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
fplot2d(x, fun) is a weak duplicate of plot(x, fun) and should be removed:
1) plot(x, fun) does the same than fplot2d(x, fun) when fun is a scilab macro or builtin.
Keeping both is useless.
2) plot(x, list(fun, params)) is able to plot a function having some additional input parameters.
fplot2d() can't plot such functions.
3) plot(x, fun) detects when fun is vectorized and then calls it only once, instead of using feval() as in fplot2d().
This makes plot() much faster. See http://bugzilla.scilab.org/show_bug.cgi?id=15659#c1
4) fplot2d() badly tests its first input argument with
if type(xr)=="10" then // logflag passed first
error(msprintf(gettext("%s: Wrong size for input argument #%d: A vector expected.\n"), "fplot2d", 1));
The test is always false, and if it would be correct, the message looks not related.
5) fplot2d() accepts the name of a fortran function, but this is not really documented.
For instance, fplot2d(x, "parab") works, although we have
--> parab
Undefined variable: parab
Such calls look somewhat like hacking.
Instead, plot(x, feval(x,"parab")) does directly the same, with all plot() facilities.
This does not allow the fortran function to have extra parameters, but it is not worse than the current status.