<?xml version="1.0" encoding="UTF-8"?>
<!--
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) ENPC - Jean-Philippe Chancelier
*
 * 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.
*
-->
<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="xpoly">
    <refnamediv>
        <refname>xpoly</refname>
        <refpurpose>draw a polyline or a
            polygon
        </refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>xpoly(xv,yv [,dtype [,close]])</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>xv,yv</term>
                <listitem>
                    <para>matrices of the same size (points of the polyline).</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>dtype</term>
                <listitem>
                    <para>string (drawing style). default value is "lines".</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>close</term>
                <listitem>
                    <para>integer. If close=1, the polyline is closed; default value is
                        0.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            <literal>xpoly</literal> draws a single polyline described by the vectors of
            coordinates <literal>xv</literal> and <literal>yv</literal>. If <literal>xv</literal> and
            <literal>yv</literal> are matrices they are considered as vectors by
            concatenating their columns. <literal>dtype</literal> can be
            <literal>"lines"</literal> for using the current line style or
            <literal>"marks"</literal> for using the current mark to draw the polyline.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
x = sin(2*%pi*(0:4)/5);
y = cos(2*%pi*(0:4)/5);

plot2d(0,0,-1,"010"," ",[-1,-1,1,1])  // draw an empty bounded axes
xpoly(x, y)
set(gce(), "foreground", color("red"), "closed", "on");
    ]]></programlisting>
        <scilab:image>
          x = sin(2*%pi*(0:4)/5);
          y = cos(2*%pi*(0:4)/5);
          plot2d(0,0,-1,"010"," ",[-1,-1,1,1])
          xpoly(x, y)
          set(gce(), "foreground", color("red"), "closed", "on");
          gcf().axes_size = [300 300];
        </scilab:image>
        <programlisting role="example"><![CDATA[
    // With marks instead of lines
    plot2d(0,0,1,rect=[0,0,12,10], frameflag=3)
    t=[0:4]*2*%pi/5;
    x=5+5*cos(t);
    y=5+5*sin(t);
    xpoly(x,y,"marks")
    e=gce();
    set(e,"mark_style",2);
    ]]></programlisting>
        <scilab:image>
            plot2d(0,0,1,rect=[0,0,12,10], frameflag=3)
            t=[0:4]*2*%pi/5;
            x=5+5*cos(t);
            y=5+5*sin(t);
            xpoly(x,y,"marks")
            e=gce();
            set(e,"mark_style",2);
        </scilab:image>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="xfpoly">xfpoly</link>
            </member>
            <member>
                <link linkend="xfpolys">xfpolys</link>
            </member>
            <member>
                <link linkend="xpolys">xpolys</link>
            </member>
            <member>
                <link linkend="polyline_properties">polyline_properties</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
