More samples in the graphic help pages Note that they are automatically generated...
[scilab.git] / scilab / modules / graphics / help / en_US / polygon / xfpoly.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  * Copyright (C) 2011 - DIGITEO - Manuel Juliachs
6  * 
7  * This file must be used under the terms of the CeCILL.
8  * This source file is licensed as described in the file COPYING, which
9  * you should have received as part of this distribution.  The terms
10  * are also available at    
11  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
12  *
13  -->
14 <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" version="5.0-subset Scilab" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="xfpoly">
15   <info>
16     <pubdate>$LastChangedDate$</pubdate>
17   </info>
18   <refnamediv>
19     <refname>xfpoly</refname>
20     <refpurpose>fill a polygon</refpurpose>
21   </refnamediv>
22   <refsynopsisdiv>
23     <title>Calling Sequence</title>
24     <synopsis>xfpoly(xv,yv,[fill])</synopsis>
25   </refsynopsisdiv>
26   <refsection>
27     <title>Arguments</title>
28     <variablelist>
29       <varlistentry>
30         <term>xv,yv</term>
31         <listitem>
32           <para>two vectors of same size (the points of the polygon).</para>
33         </listitem>
34       </varlistentry>
35       <varlistentry>
36         <term>fill</term>
37         <listitem>
38           <para>integer, the color used to fill the polygon.</para>
39         </listitem>
40       </varlistentry>
41     </variablelist>
42   </refsection>
43   <refsection>
44     <title>Description</title>
45     <para>
46       <literal>xfpoly</literal> fills a polygon with the current color or a color specified by the
47       optional <literal>fill</literal> argument.
48     </para>
49     <para>
50       If <literal>fill</literal> is omitted, the polygon is filled with the current color and its contour is
51       drawn with the current color and line style.
52       If <literal>fill</literal> is present, it is used to fill the polygon as follows:
53     </para>
54     <itemizedlist>
55       <listitem>
56         <para>
57           <literal>if fill&lt;0</literal>, the polygon is filled with the color <literal>-fill</literal>, and
58           its contour is not drawn.
59         </para>
60       </listitem>
61       <listitem>
62         <para>
63           <literal>if fill=0</literal>, the polygon is filled with the current color and its contour is drawn
64           with the current color and line style (equivalent to <literal>fill</literal> omitted).
65         </para>
66       </listitem>
67       <listitem>
68         <para>
69           <literal>if fill&gt;0</literal>, the polygon is filled with the color <literal>fill</literal>
70           and its contour is drawn with the current color and line style.
71         </para>
72       </listitem>
73     </itemizedlist>
74   </refsection>
75   
76   <refsection>
77     <title>Sample</title>
78     <scilab:image>
79       x=sin(2*%pi*(0:4)/5);
80       y=cos(2*%pi*(0:4)/5);
81       plot2d(0,0,-1,"010"," ",[-2,-2,2,2]);
82       xset("color",5);
83       xfpoly(x,y);
84     </scilab:image>
85   </refsection>
86   
87   <refsection>
88     <title>Examples</title>
89     <programlisting role="example"><![CDATA[ 
90 x=sin(2*%pi*(0:4)/5);
91 y=cos(2*%pi*(0:4)/5);
92 plot2d(0,0,-1,"010"," ",[-2,-2,2,2]);
93 xset("color",5);
94 xfpoly(x,y);
95
96 e=gce(); // get the current entity (the last created: here the polyline)
97 e.fill_mode='off'; // shows only the contour
98
99 delete(e);
100
101 // Create a new polygon filled with color 3
102 // and its contour drawn with the current color
103 xfpoly(x,y,3);
104
105  ]]></programlisting>
106   </refsection>
107   <refsection role="see also">
108     <title>See Also</title>
109     <simplelist type="inline">
110       <member>
111         <link linkend="xfpolys">xfpolys</link>
112       </member>
113       <member>
114         <link linkend="xpoly">xpoly</link>
115       </member>
116       <member>
117         <link linkend="xpolys">xpolys</link>
118       </member>
119     </simplelist>
120   </refsection>
121 </refentry>