* Bug 15874 fixed: scatter3() renamed scatter3d() 15/20615/4
Samuel GOUGEON [Sun, 11 Nov 2018 15:55:15 +0000 (16:55 +0100)]
  http://bugzilla.scilab.org/15874

Change-Id: I46e16c4bdea34e8a78b388ff6323bb920c15e66d

21 files changed:
scilab/CHANGES.md
scilab/modules/graphics/help/en_US/2d_plot/scatter.xml
scilab/modules/graphics/help/en_US/3d_plot/scatter3d.xml [moved from scilab/modules/graphics/help/en_US/3d_plot/scatter3.xml with 92% similarity]
scilab/modules/graphics/macros/scatter.sci
scilab/modules/graphics/macros/scatter3.sci
scilab/modules/graphics/macros/scatter3d.sci [new file with mode: 0644]
scilab/modules/graphics/tests/unit_tests/scatter3.dia.ref [deleted file]
scilab/modules/graphics/tests/unit_tests/scatter3d.tst [moved from scilab/modules/graphics/tests/unit_tests/scatter3.tst with 93% similarity]
scilab/modules/helptools/data/configuration/scilab_macros.txt
scilab/modules/helptools/etc/images_md5.txt
scilab/modules/helptools/images/scatter3d_1.png [new file with mode: 0644]
scilab/modules/helptools/images/scatter3d_2.png [new file with mode: 0644]
scilab/modules/helptools/images/scatter3d_3.png [new file with mode: 0644]
scilab/modules/helptools/images/scatter3d_4.png [new file with mode: 0644]
scilab/modules/helptools/images/scatter3d_5.png [new file with mode: 0644]
scilab/modules/helptools/images/scatter3d_6.png [new file with mode: 0644]
scilab/modules/helptools/images/scatter3d_7.png [new file with mode: 0644]
scilab/modules/helptools/images/scatter3d_8.png [new file with mode: 0644]
scilab/modules/helptools/images/scatter3d_9.png [new file with mode: 0644]
scilab/modules/helptools/images/subplot_1.png
scilab/modules/slint/src/cpp/DeprecatedChecker.cpp

index 9a531da..c2319cb 100644 (file)
@@ -231,6 +231,7 @@ Obsolete functions or features
 * `noisegen` will be removed from Scilab 6.1.x. Please use `grand` instead.
 * `get_figure_handle(n)` is obsolete. Please use `findobj('figure_id',n)` instead.
 * `hist3d` is renamed `bar3d`. The former `hist3d` function is declared obsolete and will be replaced by an actual 3D histogram function in Scilab 6.2.
+* `scatter3` is obsolete. Please use `scatter3d` instead.
 
 Removed Functions
 -----------------
@@ -258,6 +259,7 @@ Bug Fixes
 ---------
 
 ### Bugs fixed in 6.1.0:
+<<<<<<< HEAD
 * [#2694](https://bugzilla.scilab.org/2694): `bitget` did not accept positive integers of types int8, int16 or int32.
 * [#5824](https://bugzilla.scilab.org/5824): The `datafit` algorithm was not documented.
 * [#6070](https://bugzilla.scilab.org/6070): How to make multiscaled plots was not documented.
@@ -363,6 +365,7 @@ Bug Fixes
 * [#15821](https://bugzilla.scilab.org/15821): `fac3d` and `fac3d1` were still in Scilab 6.0 despite they were tagged obsolete 14 years ago in Scilab 4.1
 * [#15825](https://bugzilla.scilab.org/15825): `gsort` could not sort completely dense matrices of complex numbers.
 * [#15840](https://bugzilla.scilab.org/15840): `grand(1,"prm",m)` yielded an unsqueezed size([size(m) 1]) hypermatrix
+* [#15874](https://bugzilla.scilab.org/15874): The `scatter3` function name was an unfounded naming exception. It had to be renamed `scatter3d`.
 * [#15934](https://bugzilla.scilab.org/15934): The `^ hat` page wrongly indicated that `^` applied to a rectangular matrix not being a vector is done element-wise.
 * [#15948](https://bugzilla.scilab.org/15948): `xlabel`, `ylabel`, `zlabel` and `title` needed to be upgraded.
 * [#15964](https://bugzilla.scilab.org/15954): A complex empty sparse matrix could be obtained after insertion.
index 2df796f..f916f15 100644 (file)
         </para>
         <note>
           To skip an argument, just replace it with <literal>[]</literal> like in
-          <literal>scatter3(x,y,z,[],mcolors)</literal>.
+          <literal>scatter3d(x,y,z,[],mcolors)</literal>.
         </note>
     </refsection>
     <refsection>
@@ -478,7 +478,7 @@ p.mark_background = color("darkcyan");
         <title>See also</title>
         <simplelist type="inline">
             <member>
-                <link linkend="scatter3">scatter3</link>
+                <link linkend="scatter3d">scatter3d</link>
             </member>
             <member>
                 <link linkend="plot">plot</link>
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:lang="en" xml:id="scatter3">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+          xml:lang="en" xml:id="scatter3d">
     <refnamediv>
-        <refname>scatter3</refname>
+        <refname>scatter3d</refname>
         <refpurpose>3D scatter plot</refpurpose>
     </refnamediv>
+    <refnamediv xml:id="scatter3">
+        <refname>scatter3</refname>
+        <refpurpose>3D scatter plot (obsolete)</refpurpose>
+    </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
         <synopsis>
-            polyline = scatter3(x, y, z, msizes, mcolors, "fill", marker, &lt;marker_property,value&gt;)
-            polyline = scatter3(axes_handle,...)
+            polyline = scatter3d(x, y, z, msizes, mcolors, "fill", marker, &lt;marker_property,value&gt;)
+            polyline = scatter3d(axes_handle,...)
         </synopsis>
     </refsynopsisdiv>
     <refsection>
     </refsection>
     <refsection>
         <title>Description</title>
+        <warning>
+            <literal>scatter3()</literal> is obsolete and will be removed in Scilab 6.1.x.
+            Please use <literal>scatter3d()</literal> instead.
+        </warning>
         <para>
-            <literal>scatter3(x,y,z)</literal> creates a scatter plot with markers at the locations
+            <literal>scatter3d(x,y,z)</literal> creates a scatter plot with markers at the locations
             specified by <varname>x</varname>, <varname>y</varname>, and <varname>z</varname>.
             The default type of the marker is a circle, the default color is "blue" and the default
             marker size is 36.
             This means the circle surrounding the marker has an area of 36 points squared.
         </para>
         <para>
-            Using <literal>scatter3(x,y,z,s,c)</literal> different sizes and colors for each marker
+            Using <literal>scatter3d(x,y,z,s,c)</literal> different sizes and colors for each marker
             can be specified.
             There are many different ways to specify marker types, marker colors and marker sizes.
             For more details see the description of the arguments and the examples.
             <itemizedlist>
               <listitem>
                 To skip an argument, just replace it with <literal>[]</literal> as in
-                <literal>scatter3(x,y,z,[],mcolors)</literal>.
+                <literal>scatter3d(x,y,z,[],mcolors)</literal>.
               </listitem>
               <listitem>
                  When the axes is rotated, the markers are automatically rotated as well in order
@@ -319,7 +330,7 @@ x = t .* cos(t) .* sin(t);
 y = t .* sin(t) .* sin(t);
 z = t .* cos(t);
 // create 3D scatter plot
-scatter3(x, y, z);
+scatter3d(x, y, z);
 // modify rotation angles
 gca().rotation_angles = [60, 45];
  ]]></programlisting>
@@ -328,7 +339,7 @@ gca().rotation_angles = [60, 45];
             x = t.*cos(t).*sin(t)
             y = t.*sin(t).*sin(t)
             z = t.*cos(t)
-            scatter3(x,y,z)
+            scatter3d(x,y,z)
             gca().rotation_angles = [60, 45];
         </scilab:image>
         <para>
@@ -343,7 +354,7 @@ z = t .* cos(t);
 // size according to radius
 s = linspace(50, 1, length(t));
 // create 3D scatter plot
-scatter3(x, y, z, s);
+scatter3d(x, y, z, s);
 // modify rotation angles
 gca().rotation_angles = [60, 45];
  ]]></programlisting>
@@ -353,7 +364,7 @@ gca().rotation_angles = [60, 45];
             y = t .* sin(t) .* sin(t)
             z = t .* cos(t)
             s = linspace(50, 1, length(t))
-            scatter3(x, y, z, s)
+            scatter3d(x, y, z, s)
             gca().rotation_angles = [60, 45];
         </scilab:image>
         <para>
@@ -372,7 +383,7 @@ gcf().color_map = coolcolormap(64);
 // color according to radius
 c = t;
 // create 3D scatter plot
-scatter3(x, y, z, s, c);
+scatter3d(x, y, z, s, c);
 // modify rotation angles
 gca().rotation_angles = [60, 45];
  ]]></programlisting>
@@ -384,7 +395,7 @@ gca().rotation_angles = [60, 45];
             s = linspace(50,1,length(t))
             gcf().color_map = coolcolormap(64);
             c = t
-            scatter3(x,y,z,s,c)
+            scatter3d(x,y,z,s,c)
             gca().rotation_angles = [60, 45];
         </scilab:image>
         <para>
@@ -396,7 +407,7 @@ z = linspace(0, 25, 200);
 x = z .* cos(z);
 y = z .* sin(z);
 // create 3D scatter plot
-scatter3(x, y, z, "fill");
+scatter3d(x, y, z, "fill");
 // modify rotation angles
 gca().rotation_angles = [60, 45];
  ]]></programlisting>
@@ -404,7 +415,7 @@ gca().rotation_angles = [60, 45];
             z = linspace(0,25,200)
             x = z.*cos(z)
             y = z.*sin(z)
-            scatter3(x,y,z,"fill")
+            scatter3d(x,y,z,"fill")
             gca().rotation_angles = [60, 45];
         </scilab:image>
         <para>
@@ -416,7 +427,7 @@ z = linspace(0, 25, 200);
 x = z .* cos(z);
 y = z .* sin(z);
 // create 3D scatter plot
-scatter3(x, y, z, "*");
+scatter3d(x, y, z, "*");
 // modify rotation angles
 gca().rotation_angles = [60, 45];
  ]]></programlisting>
@@ -424,7 +435,7 @@ gca().rotation_angles = [60, 45];
             z = linspace(0,25,200)
             x = z.*cos(z)
             y = z.*sin(z)
-            scatter3(x,y,z,"*")
+            scatter3d(x,y,z,"*")
             gca().rotation_angles = [60,45];
         </scilab:image>
         <para>
@@ -436,7 +447,7 @@ z = linspace(0, 25, 200);
 x = z .* cos(z);
 y = z .* sin(z);
 // create 3D scatter plot
-scatter3(x, y, z,...
+scatter3d(x, y, z,...
         "markerEdgeColor", "black",...
         "markerFaceColor", [0 .8 .8]);
 // modify rotation angles
@@ -446,7 +457,7 @@ gca().rotation_angles = [60, 45];
             z = linspace(0,25,200)
             x = z.*cos(z)
             y = z.*sin(z)
-            scatter3(x,y,z,...
+            scatter3d(x,y,z,...
             "markerEdgeColor","black",...
             "markerFaceColor",[0 .8 .8])
             gca().rotation_angles = [60, 45];
@@ -461,12 +472,12 @@ n = 20;
 z = exp(-x.^2 - y.^2);
 // create 3D scatter subplot
 subplot(2,1,1)
-scatter3(gca(), x(:), y(:), z(:));
+scatter3d(gca(), x(:), y(:), z(:));
 // modify rotation angles
 gca().rotation_angles = [60,45];
 // create 3D scatter subplot
 subplot(2,1,2)
-scatter3(gca(), x(:), y(:), z(:), "markerFaceColor", [0 .8 .8]);
+scatter3d(gca(), x(:), y(:), z(:), "markerFaceColor", [0 .8 .8]);
 // modify rotation angles
 gca().rotation_angles = [60,45];
  ]]></programlisting>
@@ -475,10 +486,10 @@ gca().rotation_angles = [60,45];
             [x,y] = meshgrid(linspace(-2,2,n))
             z = exp(-x.^2 - y.^2)
             subplot(2,1,1)
-            scatter3(gca(), x(:), y(:), z(:))
+            scatter3d(gca(), x(:), y(:), z(:))
             gca().rotation_angles = [60, 45];
             subplot(2,1,2)
-            scatter3(gca(),x(:),y(:),z(:),"markerFaceColor",[0 .8 .8])
+            scatter3d(gca(),x(:),y(:),z(:),"markerFaceColor",[0 .8 .8])
             gca().rotation_angles = [60, 45];
         </scilab:image>
         <para>
@@ -493,7 +504,7 @@ z = t .* cos(t);
 // size according to radius
 s = linspace(50, 1, length(t));
 // create 3D scatter plot
-scatter3(x, y, z, s);
+scatter3d(x, y, z, s);
 // modify rotation angles
 gca().rotation_angles = [60,45];
  ]]></programlisting>
@@ -503,7 +514,7 @@ gca().rotation_angles = [60,45];
             y = t.*sin(t).*sin(t)
             z = t.*cos(t)
             s = linspace(50,1,length(t))
-            p = scatter3(x,y,z,s)
+            p = scatter3d(x,y,z,s)
             gca().rotation_angles = [60,45];
         </scilab:image>
         <programlisting role="example"><![CDATA[
@@ -517,7 +528,7 @@ p.mark_background = color(0.5, 0.5, 0);
             y = t.*sin(t).*sin(t)
             z = t.*cos(t)
             s = linspace(50,1,length(t))
-            p = scatter3(x,y,z,s)
+            p = scatter3d(x,y,z,s)
             set(gca(),"rotation_angles",[60,45])
             // modify polyline
             p.mark_foreground = color(0.5, 0, 0)
@@ -553,7 +564,7 @@ p.mark_background = color(0.5, 0.5, 0);
             <revision>
                 <revnumber>6.0.0</revnumber>
                 <revremark>
-                    Function <function>scatter3</function> introduced.
+                    Function <function>scatter3d</function> introduced.
                 </revremark>
             </revision>
         </revhistory>
index 377801a..d2cda48 100644 (file)
@@ -36,7 +36,7 @@ function polyLine = scatter(varargin)
                 axesHandle = varargin(1);
                 X = varargin(2);
                 Y = varargin(3);
-                polyLine = scatter3(axesHandle,X,Y,[],varargin(4:n));
+                polyLine = scatter3d(axesHandle,X,Y,[],varargin(4:n));
             end
         else
             warning("Handle should be an Axes handle.")
@@ -49,7 +49,7 @@ function polyLine = scatter(varargin)
         else
             X = varargin(1);
             Y = varargin(2);
-            polyLine = scatter3(X,Y,[],varargin(3:n));
+            polyLine = scatter3d(X,Y,[],varargin(3:n));
         end
     end
     
index 549ec2b..7ffdf58 100644 (file)
@@ -12,6 +12,8 @@
 
 function polyLine = scatter3(varargin)
 
+    warnobsolete("scatter3d()", "6.1.x")
+
     polyLine = 0;
     [lhs,rhs] = argn(0);
 
@@ -20,7 +22,7 @@ function polyLine = scatter3(varargin)
         z = linspace(0,25,200);
         x = z.*cos(z);
         y = z.*sin(z);
-        polyLine = scatter3(x,y,z,z,z,"fill","markerEdgeColor","darkblue");
+        polyLine = scatter3d(x,y,z,z,z,"fill","markerEdgeColor","darkblue");
         set(gca(),"rotation_angles",[60,45])
         return;
     end
diff --git a/scilab/modules/graphics/macros/scatter3d.sci b/scilab/modules/graphics/macros/scatter3d.sci
new file mode 100644 (file)
index 0000000..620504f
--- /dev/null
@@ -0,0 +1,438 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) Scilab Enterprises - 2015 - 2012 - Juergen Koch <juergen.koch@hs-esslingen.de>
+//
+// Copyright (C) 2012 - 2016 - Scilab Enterprises
+//
+// This file is hereby licensed under the terms of the GNU GPL v2.0,
+// pursuant to article 5.3.4 of the CeCILL v.2.1.
+// This file was originally licensed under the terms of the CeCILL v2.1,
+// and continues to be available under such terms.
+// For more information, see the COPYING file which you should have received
+// along with this program.
+
+function polyLine = scatter3d(varargin)
+
+    polyLine = 0;
+    [lhs,rhs] = argn(0);
+
+    if ~rhs
+        clf;
+        z = linspace(0,25,200);
+        x = z.*cos(z);
+        y = z.*sin(z);
+        polyLine = scatter3d(x,y,z,z,z,"fill","markerEdgeColor","darkblue");
+        set(gca(),"rotation_angles",[60,45])
+        return;
+    end
+
+   //detect and set the current axes now:
+    if type(varargin(1)) == 9 then // graphic handle
+        hdle = varargin(1);
+        if hdle.type == "Axes" then
+            if size(varargin) < 4 then
+                warning("Not enough input arguments.")
+                return;
+            else
+                axesHandle = varargin(1);
+                X = varargin(2);
+                Y = varargin(3);
+                Z = varargin(4);
+                nextArgin = 5;
+            end
+        else
+            warning("Handle should be an Axes handle.")
+            return;
+        end
+    else
+        if size(varargin) < 3 then
+            warning("Not enough input arguments.")
+            return;
+        else
+            axesHandle = [];
+            X = varargin(1);
+            Y = varargin(2);
+            Z = varargin(3);
+            nextArgin = 4;
+        end
+    end
+
+    if (isempty(X) & isempty(Y) & isempty(Z)) then
+        // nothing has to be done
+        return;
+    end
+
+    if ( isempty(Z) ) then
+        if (~isvector(X) | ~isvector(Y) | size(X) ~= size(Y)) then
+            warning("X and Y must be vectors of the same length.")
+            return;
+        end
+    else
+        if (~isvector(X) | ~isvector(Y) | ~isvector(Z) | or(size(X) ~= size(Y)) | or(size(X) ~= size(Z))) then
+            warning("X, Y and Z must be vectors of the same length.")
+            return;
+        end
+    end
+
+    n = length(X);
+    [S,C,thickness,markStyle,markFg,markBg,fill,scanFailed] = scatterScanVargin(varargin,nextArgin,n);
+    if (scanFailed) then
+        return;
+    end
+
+    f = gcf();
+    old_drawing_mode = f.immediate_drawing;
+    f.immediate_drawing = "off";
+
+    if isempty(Z) then
+        if isempty(axesHandle) then
+            plot(X,Y);
+        else
+            plot(axesHandle,X,Y);
+        end
+        currentEntity = gce();
+        polyLine = currentEntity.children;
+    else
+        if isempty(axesHandle) then
+            param3d(X,Y,Z);
+        else
+            set("current_axes",axesHandle)
+            param3d(X,Y,Z);
+        end
+        polyLine = gce();
+    end
+
+    if polyLine.Type <> "Polyline" then
+        warning("Handle should be a Polyline handle.");
+    else
+        scatterSetPolyline(polyLine,S,C,thickness,markStyle,markFg,markBg,fill);
+
+        if ~isempty(Z) then
+            set(gca(),"cube_scaling","on");
+            set(gca(),"grid",[1 1 1]);
+        end
+    end
+
+    f.immediate_drawing = old_drawing_mode;
+endfunction
+
+function [S,C,thickness,markStyle,markFg,markBg,fill,scanFailed] = scatterScanVargin(argins,nextArgin,n)
+
+    scanFailed = %F;
+
+    // check for size argument
+    S = [];
+    if  size(argins) >= nextArgin then
+        if isempty(argins(nextArgin)) then
+            nextArgin = nextArgin + 1;
+        else
+            if type(argins(nextArgin)) == 1 then
+                [n1,n2] = size(argins(nextArgin));
+                if (n1 == 1 & n2 == 1) | (n1 == n & n2 == 1) | (n1 == 1 & n2 == n) then
+                    S = argins(nextArgin);
+                    if iscolumn(S) then
+                        S = S.';
+                    end
+                    nextArgin = nextArgin + 1;
+                else
+                    warning("S must be a scalar or a vector of the same length as X.");
+                    scanFailed = %T;
+                    return;
+                end
+            end
+        end
+    end
+
+    // check for color argument
+    C = [];
+    if  size(argins) >= nextArgin then
+        if isempty(argins(nextArgin)) then
+            nextArgin = nextArgin + 1;
+        else
+            [n1,n2] = size(argins(nextArgin));
+            if type(argins(nextArgin)) == 1 then
+                if (n1 == n & n2 == 1) | (n1 == 1 & n2 == n) then
+                    C = scatterLinearColorMap(argins(nextArgin));
+                    nextArgin = nextArgin + 1;
+                elseif n1 == n & n2 == 3 then
+                    C = addcolor(argins(nextArgin));
+                    nextArgin = nextArgin + 1;
+                else
+                    warning("C must be a vector or a matrix of the same length as X.");
+                    scanFailed = %T;
+                    return;
+                end
+                if iscolumn(C) then
+                    C = C.';
+                end
+            elseif type(argins(nextArgin)) == 10 then
+                if n1 == 1 & n2 == 1 then
+                    // check if string specifies a color
+                    colorRGB = name2rgb(argins(nextArgin));
+                    if ~isempty(colorRGB) then
+                        C = addcolor(colorRGB/255);
+                        nextArgin = nextArgin + 1;
+                    end
+                elseif (n1 == n & n2 == 1) | (n1 == 1 & n2 == n) then
+                    C = addcolor(name2rgb(argins(nextArgin))/255);
+                    if isempty(C) then
+                        warning("Wrong color specified.");
+                        scanFailed = %T;
+                        return;
+                    else
+                         nextArgin = nextArgin + 1;
+                    end
+                end
+            end
+        end
+    end
+
+    // check for "fill" argument
+    fill = %F;
+    if  size(argins) >= nextArgin then
+        if type(argins(nextArgin)) == 10 then
+            if argins(nextArgin) == "fill" then
+                fill = %T;
+                nextArgin = nextArgin + 1;
+            end
+        end
+    end
+
+    // check for marker argument
+    markStyle = 9; // default circle
+    if  size(argins) >= nextArgin then
+        if type(argins(nextArgin)) == 10 then
+            ms = getMarkStyle(argins(nextArgin));
+            if ms >= 0 & ms <= 14 then
+                markStyle = ms;
+                nextArgin = nextArgin + 1;
+            end
+        end
+    end
+
+    // check for property-value pairs
+    markFg = -1;
+    markBg = -1;
+    thickness = 1.0; // default
+    while  size(argins) >= nextArgin do
+        if size(argins) == nextArgin then
+            warning("Incorrect number of inputs for property-value pairs.");
+            scanFailed = %T;
+            return;
+        else
+            select argins(nextArgin)
+            case "marker"
+                markStyle = getMarkStyle(argins(nextArgin+1));
+                if markStyle == -1 then
+                    warning(strcat([argins(nextArgin+1) " is not a valid value for property marker."]));
+                    scanFailed = %T;
+                    return;
+                end
+            case "markerStyle"
+                markStyle = getMarkStyle(argin(nextArgin+1));
+                if markStyle == -1 then
+                    warning(strcat([argins(nextArgin+1) " is not a valid value for property markerStyle."]));
+                    scanFailed = %T;
+                    return;
+                end
+            case "markerEdgeColor"
+                markFg = colorIndex(argins(nextArgin+1));
+                if markFg == -1 then
+                    warning(strcat([argins(nextArgin+1) " is not a valid value for property markerEdgeColor."]));
+                    scanFailed = %T;
+                    return;
+                end;
+            case "markerForeground"
+                markFg = colorIndex(argins(nextArgin+1));
+                if markFg == -1 then
+                    warning(strcat([argins(nextArgin+1) " is not a valid value for property markerForeground."]));
+                    scanFailed = %T;
+                    return;
+                end;
+            case "markerFaceColor"
+                fill = %T;
+                markBg = colorIndex(argins(nextArgin+1));
+                if markBg == -1 then
+                    warning(strcat([argins(nextArgin+1) " is not a valid value for property markerFaceColor."]));
+                    scanFailed = %T;
+                    return;
+                end;
+            case "markerBackground"
+                fill = %T;
+                markBg = colorIndex(argins(nextArgin+1));
+                if markBg == -1 then
+                    warning(strcat([argins(nextArgin+1) " is not a valid value for property markerBackground."]));
+                    scanFailed = %T;
+                    return;
+                end;
+            case "linewidth"
+                if type(argins(nextArgin+1)) == 1 then
+                    thickness = argins(nextArgin+1);
+                else
+                    warning(strcat([argins(nextArgin+1) " is not a valid value for property linewidth."]));
+                    scanFailed = %T;
+                    return;
+                end
+            case "thickness"
+                if type(argins(nextArgin+1)) == 1 then
+                    thickness = argins(nextArgin+1);
+                else
+                    warning(strcat([argins(nextArgin+1) " is not a valid value for property thickness."]));
+                    scanFailed = %T;
+                    return;
+                end
+            else
+                warning(strcat(["There is no " argins(nextArgin) " property on the Scatter class."]));
+                scanFailed = %T;
+                return;
+            end
+        end
+        nextArgin = nextArgin + 2;
+    end
+
+endfunction
+
+function colorInd = colorIndex(colorSpec)
+    colorInd = -1;
+    if type(colorSpec) == 10 & size(colorSpec) == [1 1] then
+        colorRGB = name2rgb(colorSpec);
+        if ~isempty(colorRGB) then
+            colorInd = addcolor(colorRGB/255);
+            return;
+        end
+    elseif type(colorSpec) == 1 & (size(colorSpec) == [1 3] | size(colorSpec) == [3 1]) then
+        colorInd = addcolor(colorSpec);
+        return;
+    end
+    warning("Specified string is an invalid color value.");
+endfunction
+
+function markStyle = getMarkStyle(name)
+    if type(name) ~= 10 then
+        markStyle = -1;
+    else
+        select name
+        case "."
+            markStyle = 0;
+        case "+"
+            markStyle = 1;
+        case "x"
+            markStyle = 2;
+        case "circle plus"
+            markStyle = 3;
+        case "filled diamond"
+            markStyle = 4;
+        case "d"
+            markStyle = 5;
+        case "diamond"
+            markStyle = 5;
+        case "^"
+            markStyle = 6;
+        case "v"
+            markStyle = 7;
+        case "diamond plus"
+            markStyle = 8;
+        case "o"
+            markStyle = 9;
+        case "*"
+            markStyle = 10;
+        case "s"
+            markStyle = 11;
+        case "square"
+            markStyle = 11;
+        case ">"
+            markStyle = 12;
+        case "<"
+            markStyle = 13;
+        case "p"
+            markStyle = 14;
+        case "pentagram"
+            markStyle = 14;
+        else
+            markStyle = -1;
+        end
+    end
+endfunction
+
+function colorIndex = scatterLinearColorMap(colorValue)
+    cMin = min(colorValue);
+    cMax = max(colorValue);
+    cmap = get(gcf(),"color_map");
+    numColors = size(cmap,1);
+    if (cMax-cMin > %eps) then
+        colorIndex = (numColors-1)*(colorValue - cMin)/(cMax - cMin) + 1;
+    else
+        colorIndex = 1; // default color index
+    end
+endfunction
+
+function scatterSetPolyline(polyLine,S,C,thickness,markStyle,markFg,markBg,fill)
+
+    // set mark mode
+    polyLine.line_mode = "off";
+    polyLine.mark_mode = "on";
+
+    // set thickness
+    polyLine.thickness = thickness;
+
+    // set mark style
+    polyLine.mark_style = markStyle;
+
+    // set mark size
+    polyLine.mark_size_unit = "point";
+    if isempty(S) then
+        polyLine.mark_size = 7;
+    else
+        if size(S) == [1 1] | size(S) == [1 n]
+            polyLine.mark_size = ceil(sqrt(4*S/%pi));
+        else
+            warning("S must be a scalar or a vector of the same length as X.");
+            return;
+        end
+    end
+
+    // set mark foreground and background color
+    if isempty(C) then
+        if markFg == -1 then
+            markFg = addcolor(name2rgb("blue")/255); // default
+        end
+        polyLine.mark_foreground = markFg;
+        if markBg == -1 then
+            markBg = markFg;
+        end
+        if fill == %T then
+            polyLine.mark_background = markBg;
+        else
+            polyLine.mark_background = 0; // transparent
+        end
+     else
+        if size(C) == [1 1] then
+            polyLine.mark_foreground = C;
+            if fill == %T then
+                polyLine.mark_background = C;
+            else
+                if markBg == -1 then
+                    polyLine.mark_background = 0; // transparent
+                else
+                    polyLine.mark_background = markBg;
+                end
+            end
+        else
+            if fill == %T then
+                if markFg == -1 then
+                    polyLine.mark_foreground = C; // transparent
+                else
+                    polyLine.mark_foreground = markFg;
+                end
+                polyLine.mark_background = C;
+            else
+                polyLine.mark_foreground = C;
+                if markBg == -1 then
+                    polyLine.mark_background = 0; // transparent
+                else
+                    polyLine.mark_background = markBg;
+                end
+            end
+        end
+    end
+
+endfunction
diff --git a/scilab/modules/graphics/tests/unit_tests/scatter3.dia.ref b/scilab/modules/graphics/tests/unit_tests/scatter3.dia.ref
deleted file mode 100644 (file)
index e94ace9..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) Scilab Enterprises - 2015-2010 - Juergen Koch <juergen.koch@hs-esslingen.de>
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- TEST WITH GRAPHIC -->
-//
-// Test data
-t = 1:200;
-x = t.*cos(t).*sin(t);
-y = t.*sin(t).*sin(t);
-z = t.*cos(t);
-s = linspace(50,1,length(t));
-//
-// Test #1 Create 3D scatter plot 
-h = scf();
-p = scatter3(x,y,z);
-assert_checkequal(p.line_mode,"off");
-assert_checkequal(p.fill_mode,"off");
-assert_checkequal(p.thickness,1);
-assert_checkequal(p.mark_mode,"on");
-assert_checkequal(p.mark_style,9);
-assert_checkequal(p.mark_size_unit,"point");
-assert_checkequal(p.mark_size,7);
-assert_checkequal(p.mark_foreground,2);
-assert_checkequal(p.mark_background,0);
-set(gca(),"rotation_angles",[60,45]);
-close(h);
-//
-// Test #2 Vary marker size 
-h = scf();
-p = scatter3(x,y,z,s);
-assert_checkequal(p.line_mode,"off");
-assert_checkequal(p.fill_mode,"off");
-assert_checkequal(p.thickness,1);
-assert_checkequal(p.mark_mode,"on");
-assert_checkequal(p.mark_style,9);
-assert_checkequal(p.mark_size_unit,"point");
-assert_checkequal(p.mark_size,ceil(sqrt(4*s/%pi)));
-assert_checkequal(p.mark_foreground,2);
-assert_checkequal(p.mark_background,0);
-set(gca(),"rotation_angles",[60,45]);
-close(h);
-//
-// Test #3 Vary marker size and color
-h = scf();
-set(gcf(),"color_map",coolcolormap(64));
-p = scatter3(x,y,z,s,t);
-assert_checkequal(p.line_mode,"off");
-assert_checkequal(p.fill_mode,"off");
-assert_checkequal(p.thickness,1);
-assert_checkequal(p.mark_mode,"on");
-assert_checkequal(p.mark_style,9);
-assert_checkequal(p.mark_size_unit,"point");
-assert_checkequal(p.mark_size,ceil(sqrt(4*s/%pi)));
-assert_checkequal(p.mark_foreground,floor((64-1)*(t-min(t))/(max(t)-min(t))+1));
-assert_checkequal(p.mark_background,0);
-set(gca(),"rotation_angles",[60,45]);
-close(h);
-//
-// Test data
-z = linspace(0,25,200);
-x = z.*cos(z);
-y = z.*sin(z);
-//
-// Test #4 Fill the markers
-h = scf();
-p = scatter3(x,y,z,"fill");
-assert_checkequal(p.line_mode,"off");
-assert_checkequal(p.fill_mode,"off");
-assert_checkequal(p.thickness,1);
-assert_checkequal(p.mark_mode,"on");
-assert_checkequal(p.mark_style,9);
-assert_checkequal(p.mark_size_unit,"point");
-assert_checkequal(p.mark_size,7);
-assert_checkequal(p.mark_foreground,2);
-assert_checkequal(p.mark_background,2);
-set(gca(),"rotation_angles",[60,45]);
-close(h);
-//
-// Test #5 Specify marker symbol
-h = scf();
-p = scatter3(x,y,z,"*");
-assert_checkequal(p.line_mode,"off");
-assert_checkequal(p.fill_mode,"off");
-assert_checkequal(p.thickness,1);
-assert_checkequal(p.mark_mode,"on");
-assert_checkequal(p.mark_style,10);
-assert_checkequal(p.mark_size_unit,"point");
-assert_checkequal(p.mark_size,7);
-assert_checkequal(p.mark_foreground,2);
-assert_checkequal(p.mark_background,0);
-set(gca(),"rotation_angles",[60,45]);
-close(h);
-//
-// Test #6 Change marker edge and face color
-h = scf();
-p = scatter3(x,y,z,...
-         "markerEdgeColor","black",...
-         "markerFaceColor",[0 .8 .8]);
-assert_checkequal(p.line_mode,"off");
-assert_checkequal(p.fill_mode,"off");
-assert_checkequal(p.thickness,1);
-assert_checkequal(p.mark_mode,"on");
-assert_checkequal(p.mark_style,9);
-assert_checkequal(p.mark_size_unit,"point");
-assert_checkequal(p.mark_size,7);
-assert_checkequal(p.mark_foreground,color("black"));
-assert_checkequal(p.mark_background,color(0,.8*255,.8*255));
-set(gca(),"rotation_angles",[60,45]);
-close(h);
-//
-// Test #7 Specify subplot for scatter plot
-h = scf();
-[x,y] = meshgrid(linspace(-2,2,20));
-z = exp(-x.^2-y.^2);
-subplot(2,1,1);
-p1 = scatter3(gca(),x(:),y(:),z(:));
-assert_checkequal(p1.line_mode,"off");
-assert_checkequal(p1.fill_mode,"off");
-assert_checkequal(p1.thickness,1);
-assert_checkequal(p1.mark_mode,"on");
-assert_checkequal(p1.mark_style,9);
-assert_checkequal(p1.mark_size_unit,"point");
-assert_checkequal(p1.mark_size,7);
-assert_checkequal(p1.mark_foreground,2);
-assert_checkequal(p1.mark_background,0);
-set(gca(),"rotation_angles",[60,45]);
-subplot(2,1,2);
-p2 = scatter3(gca(),x(:),y(:),z(:),"markerFaceColor",[0 .8 .8]);
-assert_checkequal(p2.line_mode,"off");
-assert_checkequal(p2.fill_mode,"off");
-assert_checkequal(p2.thickness,1);
-assert_checkequal(p2.mark_mode,"on");
-assert_checkequal(p2.mark_style,9);
-assert_checkequal(p2.mark_size_unit,"point");
-assert_checkequal(p2.mark_size,7);
-assert_checkequal(p2.mark_foreground,2);
-assert_checkequal(p2.mark_background,color(0,.8*255,.8*255));
-set(gca(),"rotation_angles",[60,45]);
-close(h);
-//
-// Test data
-t = 1:200;
-x = t.*cos(t).*sin(t);
-y = t.*sin(t).*sin(t);
-z = t.*cos(t);
-s = linspace(50,1,length(t));
-//
-// Test #8 Modify scatter plot after creation
-h = scf();
-p = scatter3(x,y,z,s);
-p.mark_foreground = addcolor([0.5 0 0]);
-p.mark_background = addcolor([0.5 0.5 0]);
-assert_checkequal(p.line_mode,"off");
-assert_checkequal(p.fill_mode,"off");
-assert_checkequal(p.thickness,1);
-assert_checkequal(p.mark_mode,"on");
-assert_checkequal(p.mark_style,9);
-assert_checkequal(p.mark_size_unit,"point");
-assert_checkequal(p.mark_size,ceil(sqrt(4*s/%pi)));
-assert_checkequal(p.mark_foreground,color(0.5*255,0,0));
-assert_checkequal(p.mark_background,color(0.5*255,0.5*255,0));
-set(gca(),"rotation_angles",[60,45]);
-close(h);
@@ -6,6 +6,7 @@
 // =============================================================================
 
 // <-- TEST WITH GRAPHIC -->
+// <-- NO CHECK REF -->
 
 //
 // Test data
@@ -16,9 +17,9 @@ z = t.*cos(t);
 s = linspace(50,1,length(t));
 
 //
-// Test #1 Create 3D scatter plot 
+// Test #1 Create 3D scatter plot
 h = scf();
-p = scatter3(x,y,z);
+p = scatter3d(x,y,z);
 assert_checkequal(p.line_mode,"off");
 assert_checkequal(p.fill_mode,"off");
 assert_checkequal(p.thickness,1);
@@ -31,9 +32,9 @@ assert_checkequal(p.mark_background,0);
 set(gca(),"rotation_angles",[60,45]);
 close(h);
 //
-// Test #2 Vary marker size 
+// Test #2 Vary marker size
 h = scf();
-p = scatter3(x,y,z,s);
+p = scatter3d(x,y,z,s);
 assert_checkequal(p.line_mode,"off");
 assert_checkequal(p.fill_mode,"off");
 assert_checkequal(p.thickness,1);
@@ -49,7 +50,7 @@ close(h);
 // Test #3 Vary marker size and color
 h = scf();
 set(gcf(),"color_map",coolcolormap(64));
-p = scatter3(x,y,z,s,t);
+p = scatter3d(x,y,z,s,t);
 assert_checkequal(p.line_mode,"off");
 assert_checkequal(p.fill_mode,"off");
 assert_checkequal(p.thickness,1);
@@ -71,7 +72,7 @@ y = z.*sin(z);
 //
 // Test #4 Fill the markers
 h = scf();
-p = scatter3(x,y,z,"fill");
+p = scatter3d(x,y,z,"fill");
 assert_checkequal(p.line_mode,"off");
 assert_checkequal(p.fill_mode,"off");
 assert_checkequal(p.thickness,1);
@@ -86,7 +87,7 @@ close(h);
 //
 // Test #5 Specify marker symbol
 h = scf();
-p = scatter3(x,y,z,"*");
+p = scatter3d(x,y,z,"*");
 assert_checkequal(p.line_mode,"off");
 assert_checkequal(p.fill_mode,"off");
 assert_checkequal(p.thickness,1);
@@ -101,7 +102,7 @@ close(h);
 //
 // Test #6 Change marker edge and face color
 h = scf();
-p = scatter3(x,y,z,...
+p = scatter3d(x,y,z,...
          "markerEdgeColor","black",...
          "markerFaceColor",[0 .8 .8]);
 assert_checkequal(p.line_mode,"off");
@@ -121,7 +122,7 @@ h = scf();
 [x,y] = meshgrid(linspace(-2,2,20));
 z = exp(-x.^2-y.^2);
 subplot(2,1,1);
-p1 = scatter3(gca(),x(:),y(:),z(:));
+p1 = scatter3d(gca(),x(:),y(:),z(:));
 assert_checkequal(p1.line_mode,"off");
 assert_checkequal(p1.fill_mode,"off");
 assert_checkequal(p1.thickness,1);
@@ -133,7 +134,7 @@ assert_checkequal(p1.mark_foreground,2);
 assert_checkequal(p1.mark_background,0);
 set(gca(),"rotation_angles",[60,45]);
 subplot(2,1,2);
-p2 = scatter3(gca(),x(:),y(:),z(:),"markerFaceColor",[0 .8 .8]);
+p2 = scatter3d(gca(),x(:),y(:),z(:),"markerFaceColor",[0 .8 .8]);
 assert_checkequal(p2.line_mode,"off");
 assert_checkequal(p2.fill_mode,"off");
 assert_checkequal(p2.thickness,1);
@@ -157,7 +158,7 @@ s = linspace(50,1,length(t));
 //
 // Test #8 Modify scatter plot after creation
 h = scf();
-p = scatter3(x,y,z,s);
+p = scatter3d(x,y,z,s);
 p.mark_foreground = addcolor([0.5 0 0]);
 p.mark_background = addcolor([0.5 0.5 0]);
 assert_checkequal(p.line_mode,"off");
index a2481da..016ada2 100644 (file)
@@ -998,7 +998,7 @@ replot_1.png=d9ab231632d9298a6f87718df49ce8ae
 replot_2.png=2bbd8e5516bcfba00fb343eff77b4736
 rotate_1.png=df252732000d1c17d23c04e038b1b0f3
 rpem_1.png=f1f661c0f1bc866f159ff8e328971f0f
-save_1.png=3735341e3e1dc6a290055825cc900ec9
+save_1.png=63b05d0803a6d3427fd26fa7cea17612
 sca_1.png=26a128db93d82d857191be51313e1d87
 scatter3_1.png=aab921f0b450aa45bfbb5664bec0041e
 scatter3_2.png=15c5d3b32f8696f4208bbb5b2bad2d71
@@ -1009,6 +1009,15 @@ scatter3_6.png=1208c36176ce151609a9e8a028e2efec
 scatter3_7.png=7b4166df26aa032d619e763b5e3d5ffb
 scatter3_8.png=78c1739441d452b32803d9afe828b9a0
 scatter3_9.png=19492ab5f75f0fb62c39fcff53985cca
+scatter3d_1.png=773a66a41a14bbf889268db7a844147b
+scatter3d_2.png=d9e4519a4d98e2eb8645e0537dbc19e8
+scatter3d_3.png=24be254e2671c45fda9e40ed4b041288
+scatter3d_4.png=f8e9ae6d215b75563d29ff932023fbc4
+scatter3d_5.png=19ee44a74c0965e982ad68330c679ca0
+scatter3d_6.png=108bf9fbffe8fb6027a5a8e4aa50c50b
+scatter3d_7.png=0972a23cc58462fbf97d7d77d1113b98
+scatter3d_8.png=4d67a4e5eafdfbe53b1ca3c6390f6c0f
+scatter3d_9.png=9fbc405d1cafead8558db57db93e0f9d
 scatter_1.png=4f9bcfe033f3f679978a95d46a1d1668
 scatter_2.png=237636079259daa7a0193f047c9b36f7
 scatter_3.png=f76e8578dcbe18c3b40ed66382632f10
@@ -1054,7 +1063,7 @@ splin_1.png=4982eeb64b3dc94cc23e16b4e5af0b15
 splin_2.png=446983411e4aa2a48c9aa96edef44404
 springcolormap_1.png=b6f8f97a269786a9d53e4fe31b097861
 stringbox_1.png=6546ab6a9d8edbd09c41eebc2b77c67b
-subplot_1.png=4178b6def9655a23b78ab238c2380d5f
+subplot_1.png=765668cf3220d7a8e1db4de8fe815b50
 subplot_2.png=ee882cd4d9decc7830268a7789c2d708
 subplot_ru_RU_2.png=809bf9fc254afe14e891c56e13606d1f
 summercolormap_1.png=b6e693f0c3ddcfcb7271926e20457ebd
diff --git a/scilab/modules/helptools/images/scatter3d_1.png b/scilab/modules/helptools/images/scatter3d_1.png
new file mode 100644 (file)
index 0000000..53694d4
Binary files /dev/null and b/scilab/modules/helptools/images/scatter3d_1.png differ
diff --git a/scilab/modules/helptools/images/scatter3d_2.png b/scilab/modules/helptools/images/scatter3d_2.png
new file mode 100644 (file)
index 0000000..40b1d7b
Binary files /dev/null and b/scilab/modules/helptools/images/scatter3d_2.png differ
diff --git a/scilab/modules/helptools/images/scatter3d_3.png b/scilab/modules/helptools/images/scatter3d_3.png
new file mode 100644 (file)
index 0000000..02c912b
Binary files /dev/null and b/scilab/modules/helptools/images/scatter3d_3.png differ
diff --git a/scilab/modules/helptools/images/scatter3d_4.png b/scilab/modules/helptools/images/scatter3d_4.png
new file mode 100644 (file)
index 0000000..6a78e33
Binary files /dev/null and b/scilab/modules/helptools/images/scatter3d_4.png differ
diff --git a/scilab/modules/helptools/images/scatter3d_5.png b/scilab/modules/helptools/images/scatter3d_5.png
new file mode 100644 (file)
index 0000000..f211da4
Binary files /dev/null and b/scilab/modules/helptools/images/scatter3d_5.png differ
diff --git a/scilab/modules/helptools/images/scatter3d_6.png b/scilab/modules/helptools/images/scatter3d_6.png
new file mode 100644 (file)
index 0000000..4527fdf
Binary files /dev/null and b/scilab/modules/helptools/images/scatter3d_6.png differ
diff --git a/scilab/modules/helptools/images/scatter3d_7.png b/scilab/modules/helptools/images/scatter3d_7.png
new file mode 100644 (file)
index 0000000..fd33f72
Binary files /dev/null and b/scilab/modules/helptools/images/scatter3d_7.png differ
diff --git a/scilab/modules/helptools/images/scatter3d_8.png b/scilab/modules/helptools/images/scatter3d_8.png
new file mode 100644 (file)
index 0000000..40b1d7b
Binary files /dev/null and b/scilab/modules/helptools/images/scatter3d_8.png differ
diff --git a/scilab/modules/helptools/images/scatter3d_9.png b/scilab/modules/helptools/images/scatter3d_9.png
new file mode 100644 (file)
index 0000000..bf25210
Binary files /dev/null and b/scilab/modules/helptools/images/scatter3d_9.png differ
index 48a8671..2c7eef4 100644 (file)
Binary files a/scilab/modules/helptools/images/subplot_1.png and b/scilab/modules/helptools/images/subplot_1.png differ
index 6b70bde..91ce849 100644 (file)
@@ -119,6 +119,7 @@ std::unordered_map<std::wstring, std::wstring> DeprecatedChecker::initDep()
     map.emplace(L"with_tk", L"with_module('tclsci')");
     map.emplace(L"xgetech", L"gca");
     map.emplace(L"xinfo", L"gcf().info_message");
+    map.emplace(L"scatter3", L"scatter3d");
 
     // Scilab 5.5.2 => 6.0.0
     map.emplace(L"fort", L"call");