scatterScanVargin and ScatterSetPolyline moved to scatter3
[scilab.git] / scilab / modules / graphics / macros / scatter.sci
1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) Scilab Enterprises - 2015 - 2012 - Juergen Koch <juergen.koch@hs-esslingen.de>
3 // 
4 // This file must be used under the terms of the CeCILL.
5 // This source file is licensed as described in the file COPYING, which
6 // you should have received as part of this distribution.  The terms
7 // are also available at    
8 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
9
10 function polyLine = scatter(varargin)
11
12     polyLine = 0;
13     [lhs,rhs] = argn(0);
14
15     if ~rhs
16         clf;
17         t = linspace(0,25,200);
18         x = t.*cos(t);
19         y = t.*sin(t);
20         polyLine = scatter(x,y,t,t,"fill","markerEdgeColor","darkblue")
21         return;
22     end
23
24     //detect and set the current axes now:
25     n = size(varargin);
26     if type(varargin(1)) == 9 then // graphic handle
27         hdle = varargin(1);
28         if hdle.type == "Axes" then
29             if n < 3 then
30                 warning("Not enough input arguments.")
31                 return;
32             else
33                 axesHandle = varargin(1);
34                 X = varargin(2);
35                 Y = varargin(3);
36                 polyLine = scatter3(axesHandle,X,Y,[],varargin(4:n));
37             end
38         else
39             warning("Handle should be an Axes handle.")
40             return;
41         end
42     else
43         if size(varargin) < 2 then
44             warning("Not enough input arguments.")
45             return;
46         else
47             X = varargin(1);
48             Y = varargin(2);
49             polyLine = scatter3(X,Y,[],varargin(3:n));
50         end
51     end
52     
53 endfunction