842023f5d23731a23f9c57d5558576467a469e49
[scilab.git] / scilab / modules / graphics / help / en_US / 3d_plot / hist3d.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) INRIA - Serge Steer
5  * Copyright (C) ENPC - Jean-Philippe Chancelier
6  *
7  * Copyright (C) 2012 - 2016 - Scilab Enterprises
8  *
9  * This file is hereby licensed under the terms of the GNU GPL v2.0,
10  * pursuant to article 5.3.4 of the CeCILL v.2.1.
11  * This file was originally licensed under the terms of the CeCILL v2.1,
12  * and continues to be available under such terms.
13  * For more information, see the COPYING file which you should have received
14  * along with this program.
15  *
16  -->
17 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:id="hist3d" xml:lang="en">
18     <refnamediv>
19         <refname>hist3d</refname>
20         <refpurpose>3D representation of a histogram</refpurpose>
21     </refnamediv>
22     <refsynopsisdiv>
23         <title>Syntax</title>
24         <synopsis>hist3d(mtx,[theta,alpha,leg,flag,ebox])
25             hist3d(mtx,&lt;opt_args&gt;)
26             hist3d(list(mtx,x,y),[theta,alpha,leg,flag,ebox])
27             hist3d(list(mtx,x,y),&lt;opt_args&gt;)
28         </synopsis>
29     </refsynopsisdiv>
30     <refsection>
31         <title>Arguments</title>
32         <variablelist>
33             <varlistentry>
34                 <term>mtx</term>
35                 <listitem>
36                     <para>matrix of size (m,n) defining the histogram
37                         <literal>mtx(i,j)=F(x(i),y(j))</literal>, where <literal>x</literal>
38                         and <literal>y</literal> are taken as <literal>0:m</literal> and
39                         <literal>0:n</literal>.
40                     </para>
41                 </listitem>
42             </varlistentry>
43             <varlistentry>
44                 <term>list(mtx,x,y)</term>
45                 <listitem>
46                     <para>where mtx is a matrix of size (m,n)defining the histogram
47                         <literal>mtx(i,j)=F(x(i),y(j))</literal>, with <literal>x</literal>
48                         and <literal>y</literal> vectors of size (1,m+1) and (1,n+1).
49                     </para>
50                 </listitem>
51             </varlistentry>
52             <varlistentry>
53                 <term>&lt;opt_args&gt;</term>
54                 <listitem>
55                     <para>
56                         This represents a sequence of statements <literal>key1=value1,
57                             key2=value2
58                         </literal>
59                         ,... where <literal>key1</literal>,
60                         <literal>key2,...</literal> can be one of the following: theta,
61                         alpha,leg,flag,ebox. See <link linkend="plot3d">plot3d</link>.
62                     </para>
63                 </listitem>
64             </varlistentry>
65             <varlistentry>
66                 <term>theta,alpha,leg,flag,ebox</term>
67                 <listitem>
68                     <para>
69                         see <link linkend="plot3d">plot3d</link>.
70                     </para>
71                 </listitem>
72             </varlistentry>
73         </variablelist>
74     </refsection>
75     <refsection>
76         <title>Description</title>
77         <para>
78             <literal>hist3d</literal> represents a 2d histogram as a 3D plot.
79             The values are associated to the intervals <literal>[x(i) x(i+1)[ X [y(i)
80                 y(i+1)[
81             </literal>
82             .
83         </para>
84         <para>
85             Enter the command <literal>hist3d()</literal> to see a demo.
86         </para>
87     </refsection>
88     <refsection>
89         <title>Examples</title>
90         <programlisting role="example"><![CDATA[
91         hist3d();
92  ]]></programlisting>
93
94         <scilab:image localized="true">hist3d();</scilab:image>
95         <programlisting role="example"><![CDATA[
96 hist3d(10*rand(10,10));
97  ]]></programlisting>
98         <scilab:image>hist3d(10*rand(10,10));</scilab:image>
99         <programlisting role="example"><![CDATA[
100 Z = zeros(100,5);
101 A = abs(rand(40,5));
102 Z(1:40,:) = A;
103 scf();
104 hist3d(Z);
105  ]]></programlisting>
106         <scilab:image>
107             Z = zeros(100,5);
108             A = abs(rand(40,5));
109             Z(1:40,:) = A;
110             scf();
111             hist3d(Z);
112         </scilab:image>
113         <programlisting role="example"><![CDATA[
114 Z = zeros(100,5);
115 A = abs(rand(40,5));
116 Z(1:40,:) = A;
117 Index = find(Z==0);
118 Z(Index) = %nan;
119 scf();
120 hist3d(Z);
121  ]]></programlisting>
122         <scilab:image>
123             Z = zeros(100,5);
124             A = abs(rand(40,5));
125             Z(1:40,:) = A;
126             Index = find(Z==0);
127             Z(Index) = %nan;
128             scf();
129             hist3d(Z);
130         </scilab:image>
131         <programlisting role="example"><![CDATA[
132 Z = zeros(100,5);
133 A = abs(rand(40,5));
134 Z(1:40,:) = A;
135 A = abs(rand(10,5));
136 Z(91:100,:) = A;
137 scf();
138 hist3d(Z);
139  ]]></programlisting>
140         <scilab:image>
141             Z = zeros(100,5);
142             A = abs(rand(40,5));
143             Z(1:40,:) = A;
144             A = abs(rand(10,5));
145             Z(91:100,:) = A;
146             scf();
147             hist3d(Z);
148         </scilab:image>
149     </refsection>
150     <refsection role="see also">
151         <title>See also</title>
152         <simplelist type="inline">
153             <member>
154                 <link linkend="histplot">histplot</link>
155             </member>
156             <member>
157                 <link linkend="plot3d">plot3d</link>
158             </member>
159         </simplelist>
160     </refsection>
161 </refentry>