1 <?xml version="1.0" encoding="UTF-8"?>
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) ENPC - Jean-Philippe Chancelier
6 * This file must be used under the terms of the CeCILL.
7 * This source file is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at
10 * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
13 <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="Matplot">
15 <refname>Matplot</refname>
17 2D plot of a matrix using colors
21 <title>Calling Sequence</title>
23 Matplot(a, [strf, rect, nax])
24 Matplot(a, <opt_args>)
28 <title>Arguments</title>
34 a real matrix of size (<literal>n1</literal>, <literal>n2</literal>).
39 <term><opt_args></term>
42 this represents a sequence of statements
43 <literal>key1=value1, key2=value2, ...</literal>
44 where <literal>key1</literal>,
45 <literal>key2</literal>, ... can be one of the following:
52 sets the bounds of the plot. If this key is given and
53 neither <varname>frameflag</varname> nor <varname>strf</varname> is given
54 then the <varname>y</varname> character of <varname>strf</varname> is
55 supposed to be <literal>7</literal>. See below for value.
63 sets the grids definition. If this key is given and
64 neither <varname>axesflag</varname> nor <varname>strf</varname> is given
65 then the <varname>z</varname> character of <varname>strf</varname> is
66 supposed to be <literal>1</literal>. See below for value.
71 <term>frameflag</term>
74 specifies how the frame of the plot is computed. The
75 value is an integer ranging from <literal>0</literal> to
76 <literal>8</literal>. It corresponds to the <varname>y</varname>
77 character of <varname>strf</varname>. See below.
85 specifies what kind of axes are drawn around the plot.
86 The value is an integer ranging from <literal>0</literal> to
87 <literal>5</literal>. It corresponds to the <varname>z</varname>
88 character of <varname>strf</varname>. See below.
99 is a string of length 3 <literal>"xyz"</literal>.
106 the default is <literal>"081"</literal>.
113 <para>controls the display of captions.</para>
118 <para>no caption.</para>
125 captions are displayed. They are given by the
126 optional argument <varname>leg</varname>.
137 controls the computation of the actual coordinate ranges
138 from the minimal requested values. Actual ranges can be larger
139 than minimal requirements.
146 no computation, the plot use the previous (or
155 from the <varname>rect</varname> argument.
162 <para>from the min/max of the x, y data.</para>
169 built for an isometric scale from the
170 <varname>rect</varname> argument.
177 <para>built for an isometric plot from the min/max of
185 <para>enlarged for pretty axes from the
186 <varname>rect</varname> argument.
194 enlarged for pretty axes from the min/max of the
203 like <literal>y=1</literal> but the previous plots
204 are redrawn to use the new scale.
212 like <literal>y=2</literal> but the previous plots
213 are redrawn to use the new scale.
224 controls the display of information on the frame around
225 the plot. If axes are requested, the number of ticks can be
226 specified by the <varname>nax</varname> optional argument.
232 <para>nothing is drawn around the plot.</para>
239 axes are drawn, the y-axis is displayed on the
248 the plot is surrounded by a box without ticks.
256 axes are drawn, the y-axis is displayed on the
265 axes are drawn centred in the middle of the frame box,
266 with the box disabled.
274 axes are drawn centred in the middle of the frame box,
275 with the box enabled.
289 This argument is used when the second character <literal>y</literal>
290 of argument <varname>strf</varname> is <literal>1</literal>,
291 <literal>3</literal> or <literal>5</literal>. It is a row vector of
292 size 4 and gives the dimension of the frame:
293 <literal>rect = [xmin, ymin, xmax, ymax]</literal>.
301 This argument is used when the third character <literal>z</literal>
302 of argument <varname>strf</varname> is <literal>1</literal>. It is
303 a row vector with four entries <literal>[nx, Nx, ny, Ny]</literal>
304 where <literal>nx</literal> (<literal>ny</literal>)
305 is the number of subgraduations on the x (y) axis and
306 <literal>Nx</literal> (<literal>Ny</literal>) is the number of graduations on
314 <title>Description</title>
316 The entries of matrix <code>int(a)</code> are used as colormap entries
317 in the current colormap. The color associated to <literal>a(i,j)</literal>
318 is used to draw a small square of size 1 with center at location
319 <literal>(x=j, y=(n1-i+1))</literal>.
320 If a matrix entry is outside the colormap, the corresponding rectangle is not displayed.
324 To update the Matplot data, the <literal>data</literal> field of the corresponding handle must be used.
326 <literal>data</literal> can be a matrix (or an hypermatrix) containing RGB, RGBA, ... data (see <link linkend="Matplot_properties">Matplot_properties</link>).
329 Enter the command <code>Matplot()</code> to see a demo.
333 <title>Examples</title>
334 <programlisting role="example"><![CDATA[
335 Matplot([1 2 3;4 5 6])
338 Matplot([1 2 3;4 5 6])
340 <programlisting role="example"><![CDATA[
342 // draw the current colormap
343 Matplot((1:xget("lastpattern")))
346 Matplot((1:xget("lastpattern")))
349 <refsection role="see also">
350 <title>See Also</title>
351 <simplelist type="inline">
353 <link linkend="colormap">colormap</link>
356 <link linkend="plot2d">plot2d</link>
359 <link linkend="Matplot1">Matplot1</link>
362 <link linkend="Matplot_properties">Matplot_properties</link>
367 <title>History</title>
370 <revnumber>5.5.0</revnumber>
372 <literal>data</literal> can now be a matrix (or an hypermatrix) containing RGB, RGBA, ... data (see <link linkend="Matplot_properties">Matplot_properties</link>).