72fa125c4948a2b0fa3ddf31108fefa459ef584e
[scilab.git] / scilab / modules / graphics / help / en_US / geometric_shapes / xrects.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) ENPC - Jean-Philippe Chancelier
5  * 
6  * This file must be used under the terms of the CeCILL.
7  * This source file is licensed as described in the file COPYING, which
8  * you should have received as part of this distribution.  The terms
9  * are also available at    
10  * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
11  *
12  -->
13 <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="xrects">
14     <refnamediv>
15         <refname>xrects</refname>
16         <refpurpose>draw or fill a set of rectangles</refpurpose>
17     </refnamediv>
18     <refsynopsisdiv>
19         <title>Calling Sequence</title>
20         <synopsis>xrects(rects,[fill])</synopsis>
21     </refsynopsisdiv>
22     <refsection>
23         <title>Arguments</title>
24         <variablelist>
25             <varlistentry>
26                 <term>rects</term>
27                 <listitem>
28                     <para>matrix of size (4,n).</para>
29                 </listitem>
30             </varlistentry>
31             <varlistentry>
32                 <term>fill</term>
33                 <listitem>
34                     <para>vector of size n.</para>
35                 </listitem>
36             </varlistentry>
37         </variablelist>
38     </refsection>
39     <refsection>
40         <title>Description</title>
41         <para>
42             <literal>xrects</literal> draws or fills a set of rectangles. 
43             Each column of <literal>rects</literal> describes 
44             a rectangle (upper-left point, width, height) in user coordinates:
45             <literal>rects=[x1 y1 w1 h1;x2 y2 w2 h2;...]'</literal>.
46         </para>
47         <para>
48             <literal>fill(i)</literal> gives the pattern to use for filling or drawing rectangle i:
49         </para>
50         <para>
51             if <literal>fill(i)&lt;0</literal>, rectangle <literal>i</literal> is drawn using the line style (or
52             color) <literal>-fill(i)</literal>
53         </para>
54         <para>
55             if <literal>fill(i)&gt;0</literal>, rectangle <literal>i</literal> is filled using the pattern (or
56             color) <literal>fill(i)</literal>
57         </para>
58         <para>
59             if <literal>fill(i)=0</literal>, rectangle <literal>i</literal> is drawn using the current
60             line style (or color).
61         </para>
62         <para>WARNING: please note that height is positive downwards.</para>
63     </refsection>
64     <refsection>
65         <title>Examples</title>
66         <programlisting role="example"><![CDATA[ 
67 plot2d([-100,500],[-50,50],[-1,-1],"022")
68 cols=[-34,-33,-32,-20:5:20,32,33,34];
69 x=400*(0:14)/14; step=20;
70 rects=[x;10*ones(x);step*ones(x);30*ones(x)];
71 xrects(rects,cols)
72 xnumb(x,15*ones(x),cols)
73  ]]></programlisting>
74         <scilab:image>
75             plot2d([-100,500],[-50,50],[-1,-1],"022")
76             cols=[-34,-33,-32,-20:5:20,32,33,34];
77             x=400*(0:14)/14; step=20;
78             rects=[x;10*ones(x);step*ones(x);30*ones(x)];
79             xrects(rects,cols)
80             xnumb(x,15*ones(x),cols)
81         </scilab:image>
82         
83     </refsection>
84     <refsection role="see also">
85         <title>See Also</title>
86         <simplelist type="inline">
87             <member>
88                 <link linkend="xfrect">xfrect</link>
89             </member>
90             <member>
91                 <link linkend="xrect">xrect</link>
92             </member>
93         </simplelist>
94     </refsection>
95 </refentry>