<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) INRIA - Serge Steer
 *
 * 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="scf">
    <refnamediv>
        <refname>scf</refname>
        <refpurpose>set the current graphic figure
            (window)
        </refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>
            f = scf()
            f = scf(h)
            f = scf(num)
        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>h</term>
                <listitem>
                    <para>a handle, the figure handle</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>num</term>
                <listitem>
                    <para>a number, the figure_id</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>f</term>
                <listitem>
                    <para>the handle of the current figure</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>The current figure is the destination of the graphic drawing. The
            <literal>scf</literal> function allows to change this current figure or to
            create it if it does not already exist.
        </para>
        <para/>
        <para>
            <literal>scf(num)</literal> set the figure with <literal>figure_id==num</literal>
            as the current figure. If it does not already exist it is created.
        </para>
        <para/>
        <para>
            <literal>scf(h)</literal> set the figure pointed to by the handle
            <literal>h</literal> as the current figure. If it does not already exist it is
            created.
        </para>
        <para>
            <literal>scf()</literal> is equivalent to <literal>scf(max(winsid())+1) </literal>.
            It may be used to create a new graphic window.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
f4=scf(4); //creates figure with id==4 and make it the current one
f0=scf(0); //creates figure with id==0 and make it the current one
plot2d() //draw in current figure (id=0)
scf(f4); // set first created figure as current one
plot3d() //draw in current figure (id=4)
 ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="set">set</link>
            </member>
            <member>
                <link linkend="get">get</link>
            </member>
            <member>
                <link linkend="gcf">gcf</link>
            </member>
            <member>
                <link linkend="clf">clf</link>
            </member>
            <member>
                <link linkend="winsid">winsid</link>
            </member>
            <member>
                <link linkend="graphics_entities">graphics_entities</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
