Plot, plot2d and polarplot handle %nan values in input vectors incorrectly
Reported by Pawel Zagorski
Originally assigned to Calixte DENIZET
plot.png (55.88 KB, image/png)
plot
BUG DESCRIPTION:
----------------
When executing one of the following :
plot([0 1 %nan 3 4], [0 2 4 6 8]);
plot2d([0 1 %nan 3 4], [0 2 4 6 8]);
polarplot([0 1 %nan 3 4], [0 2 4 6 8]);
Scilab ends up plotting a plot with aditional line going from a seamingly random point to [-inf +inf].
See screenshots for detail.
EXPECTED:
----------
I think user could expect one of the following to happen while input vector for plotting function:
1. Plotted line is discontinued at the point previous to the one containing the %nan value,
and starts again with another point.
2. Scilab refuses to plot and indicates an error.
I suggest the first behaviour, as this is how it worked before Scilab 5.4.1. Some libaries depend on
this first behaviour, for example CelestLab 3.0 now incorrectly plots with CL_plot_ephem() function.
See screenshot or execute celest lab example available under:
help CL_plot_ephem
HOW TO REPRODUCE THE BUG:
-------------------------
Run one of the commands
plot([0 1 %nan 3 4], [0 2 4 6 8]);
plot2d([0 1 %nan 3 4], [0 2 4 6 8]);
polarplot([0 1 %nan 3 4], [0 2 4 6 8]);
OTHER INFORMATION:
------------------
This bug was reproduced under scilab-master-1383638287 / Win7 and Scilab 5.4.1 / Fedora 19
Edited by Samuel GOUGEON