Fix help compilation (was broken since https://codereview.scilab.org/#/c/16319/)
[scilab.git] / scilab / modules / graphics / macros / scatterSetPolyline.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 scatterSetPolyline(polyLine,S,C,thickness,markStyle,markFg,markBg,fill)
11
12     // set mark mode
13     polyLine.line_mode = "off";
14     polyLine.mark_mode = "on";
15
16     // set thickness
17     polyLine.thickness = thickness;
18
19     // set mark style
20     polyLine.mark_style = markStyle;
21
22     // set mark size
23     polyLine.mark_size_unit = "point";
24     if isempty(S) then
25         polyLine.mark_size = 7;
26     else
27         if size(S) == [1 1] | size(S) == [1 n]
28             polyLine.mark_size = ceil(sqrt(4*S/%pi));
29         else
30             warning("S must be a scalar or a vector of the same length as X.");
31             return;
32         end
33     end
34
35     // set mark foreground and background color
36     if isempty(C) then
37         if markFg == -1 then
38             markFg = addcolor(name2rgb("blue")/255); // default
39         end
40         polyLine.mark_foreground = markFg;
41         if markBg == -1 then
42             markBg = markFg;
43         end
44         if fill == %T then
45             polyLine.mark_background = markBg;
46         else
47             polyLine.mark_background = 0; // transparent
48         end
49      else
50         if size(C) == [1 1] then
51             polyLine.mark_foreground = C; 
52             if fill == %T then
53                 polyLine.mark_background = C;
54             else
55                 if markBg == -1 then
56                     polyLine.mark_background = 0; // transparent
57                 else
58                     polyLine.mark_background = markBg;
59                 end
60             end
61         else
62             if fill == %T then
63                 if markFg == -1 then
64                     polyLine.mark_foreground = C; // transparent
65                 else
66                     polyLine.mark_foreground = markFg;
67                 end
68                 polyLine.mark_background = C;
69             else
70                 polyLine.mark_foreground = C;
71                 if markBg == -1 then
72                     polyLine.mark_background = 0; // transparent
73                 else
74                     polyLine.mark_background = markBg;
75                 end
76             end
77         end
78     end
79
80 endfunction
81