<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) INRIA - Djalel Abdemouche
 *
 * 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="grayplot_properties">
    <refnamediv>
        <refname>grayplot properties</refname>
        <refpurpose>description of the grayplot
            entities properties
        </refpurpose>
    </refnamediv>
    <refsection>
        <title>Description</title>
        <para>The Grayplot entity is a leaf of the graphics entities hierarchy. It
            represents 2D plots of surface using colors and images (see
            <literal>grayplot</literal>, <literal>Sgrayplot</literal>, <literal>fgrayplot</literal> and
            <literal>Sfgrayplot</literal>).
        </para>
        <variablelist>
            <varlistentry>
                <term>parent: </term>
                <listitem>
                    <para>This property contains the handle of the parent. The parent of the
                        grayplot entity should be of the type <literal>"Axes"</literal>.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>children: </term>
                <listitem>
                    <para>
                        This property contains a vector with the <literal>children</literal> of
                        the handle. However, <literal>grayplot</literal> handles currently do not
                        have any <literal>children</literal>.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>visible: </term>
                <listitem>
                    <para>
                        This field contains the <literal>visible</literal> property value for
                        the entity . It should be <literal>"on" </literal> or <literal>"off"</literal> .
                        By default, the plot is visible, the value's property is
                        <literal>"on"</literal>. If <literal>"off"</literal> the plot is not drawn on the
                        screen.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>data: </term>
                <listitem>
                    <para>
                        This field defines a <literal>tlist</literal> data structure of type
                        <literal>"grayplotdata"</literal> composed of a row and column indices of
                        each element : the x and y grid coordinates are contained respectively
                        in <literal>data.x</literal> and <literal>data.y</literal>. The complementary
                        field named <literal>data.z</literal> is the value of the surface at the
                        point <literal>(x(i),y(j))</literal> (scaled mode) or the centered value of
                        the surface defined between two consecutive <literal>x(i)</literal> and
                        <literal>y(j)</literal> (direct mode). If <literal>data_mapping</literal> (see
                        below) is set to <literal>"scaled"</literal>, the entire z data is used to
                        perform a color interpolation whereas, if <literal>data_mapping</literal>'s
                        value is <literal>"direct"</literal>, the last line and column of the z data
                        indices are ignored and the color is determined directly in the
                        colormap by the indices of the submatrix
                        <literal>data.z(1:$-1,1:$-1)</literal>.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>data_mapping: </term>
                <listitem>
                    <para>
                        By default the value of this property is <literal>"scaled"</literal> :
                        the indices of painting colors are proportional to the value
                        <literal>z</literal> coordinates. In the other case, the property takes as
                        value <literal>"direct"</literal> where the plot is a grayplot and the
                        indices of painting colors are given by the data (see above).
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>clip_state: </term>
                <listitem>
                    <para>
                        This field contains the <literal>clip_state</literal> property value for
                        the grayplot. It should be :
                    </para>
                    <itemizedlist>
                        <listitem>
                            <para>
                                <literal>"off"</literal> this means that the grayplot is not
                                clipped.
                            </para>
                        </listitem>
                        <listitem>
                            <para>
                                <literal>"clipgrf"</literal> this means that the grayplot is clipped
                                outside the Axes box.
                            </para>
                        </listitem>
                        <listitem>
                            <para>
                                <literal>"on"</literal> this means that the grayplot is clipped
                                outside the rectangle given by property clip_box.
                            </para>
                        </listitem>
                    </itemizedlist>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>clip_box: </term>
                <listitem>
                    <para>
                        This field is to determinate the <literal>clip_box</literal> property.
                        By Default its value should be an empty matrix if clip_state is "off".
                        Other cases the vector <literal>[x,y,w,h]</literal> (upper-left point width
                        height) defines the portions of the grayplot to display, however
                        <literal>clip_state</literal> property value will be changed.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>user_data: </term>
                <listitem>
                    <para>This field can be use to store any scilab variable in the grayplot
                        data structure, and to retrieve it.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
m=5;n=5;
M=round(32*rand(m,n));
grayplot(1:m,1:n,M)

a=get("current_axes");
a.data_bounds=  [-1,-1;7,7]
h=a.children

h.data_mapping="direct";

// A 2D plotting of a matrix using colors
clf()
a=get("current_axes");
a.data_bounds=  [0,0;4,4];

b=5*ones(11,11); b(2:10,2:10)=4; b(5:7,5:7)=2;
Matplot1(b,[1,1,3,3])  ;

h=a.children
for i=1:7
  xclick(); // click the mouse to sets Matplot data
  h.data=h.data+4;
end
 ]]></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="delete">delete</link>
            </member>
            <member>
                <link linkend="grayplot">grayplot</link>
            </member>
            <member>
                <link linkend="Matplot">Matplot</link>
            </member>
            <member>
                <link linkend="Matplot1">Matplot1</link>
            </member>
            <member>
                <link linkend="graphics_entities">graphics_entities</link>
            </member>
            <member>
                <link linkend="Matplot_properties">Matplot_properties</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
