<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://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="plot2d2">
    <refnamediv>
        <refname>plot2d2</refname>
        <refpurpose>2D plot (step
            function)
        </refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>plot2d2([x],y)
            plot2d2([x],y,&lt;opt_args&gt;)
            plot2d2([logflag],x,y,[style,strf,leg,rect,nax])
        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>args</term>
                <listitem>
                    <para>
                        see <literal>plot2d</literal> for a description of parameters.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            <literal>plot2d2</literal> is the same as <literal>plot2d</literal> but the
            functions given by <literal>(x,y)</literal> are supposed to be piecewise
            constant.
        </para>
        <para>By default, successive plots are superposed. To clear the previous
            plot, use <literal>clf()</literal>.
        </para>
        <para>
            Enter the command <literal>plot2d2()</literal> to see a demo.
        </para>
        <para>
            <note>
                Note that all the modes proposed by <literal>plot2dxx</literal> (xx = 1 to 4) can be enabled
                using <literal>plot2d</literal> and setting the <literal>polyline_style</literal>
                option to the corresponding number.
            </note>
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
// plots a step function of value i on the segment [i,i+1]
// the last segment is not drawn
plot2d2([1:4],[1:4],1,"111","step function",[0,0,5,5])
 ]]></programlisting>
        <scilab:image>
            plot2d2([1:4],[1:4],1,"111","step function",[0,0,5,5])
        </scilab:image>
        <programlisting role="example"><![CDATA[
// compare the following with plot2d
x=[0:0.1:2*%pi]';
clf()
plot2d2(x,[sin(x) sin(2*x) sin(3*x)])
 ]]></programlisting>
        <scilab:image>
            x=[0:0.1:2*%pi]';
            plot2d2(x,[sin(x) sin(2*x) sin(3*x)])
        </scilab:image>
        <programlisting role="example"><![CDATA[
x=[0:0.1:2*%pi]';
clf();
plot2d(x,[sin(x) sin(2*x) sin(3*x)])
e=gce();
e.children(1).polyline_style=2;
e.children(2).polyline_style=2;
e.children(3).polyline_style=2;
 ]]></programlisting>
        <scilab:image>
            x=[0:0.1:2*%pi]';
            plot2d(x,[sin(x) sin(2*x) sin(3*x)])
            e=gce();
            e.children(1).polyline_style=2;
            e.children(2).polyline_style=2;
            e.children(3).polyline_style=2;
        </scilab:image>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="plot2d">plot2d</link>
            </member>
            <member>
                <link linkend="plot2d3">plot2d3</link>
            </member>
            <member>
                <link linkend="plot2d4">plot2d4</link>
            </member>
            <member>
                <link linkend="subplot">subplot</link>
            </member>
            <member>
                <link linkend="clf">clf</link>
            </member>
            <member>
                <link linkend="polyline_properties">polyline_properties</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
