-----------
* overhauled / rewritten: `bitget`, `edit`, `factorial`, `fft`, `vectorfind`, `datafit`
-* fixed / improved: `bench_run` `M_SWITCH`, `comet`, `comet3d`
+* fixed / improved: `bench_run` `M_SWITCH`, `comet`, `comet3d`, `plot2d`
* Rewritten: `weekday`
* Translations added:
- (ru): `weekday`
* [#12889](https://bugzilla.scilab.org/12889): In the help browser, add a menu allowing to select the language of help pages, regardless of the language of the session.
* [#13593](https://bugzilla.scilab.org/13593): `csvRead()` did not take the `range` into account when `header` is provided. `[]` could not be used as default `range`.
* [#13762](https://bugzilla.scilab.org/13762): In the `fft` page, the formula for the inverse FFT missed the 1/n normalization factor.
+* [#14488](https://bugzilla.scilab.org/14488): The `frameflag=9` and `strf=".9."` values of these `plot2d` options were no longer accepted. Their documentation was ambiguous.
* [#14718](https://bugzilla.scilab.org/14718): `user` is removed for a while but was still documented.
* [#14873](https://bugzilla.scilab.org/14873): `setfield` page: The output and the 6.0 history were documented only on the en_US version. The input was wrongly restricted to matrices, while any Scilab object is acceptable. The specific role of `setfield` for mlists was not really described nor illustrated. The example did not include any call to setfield.
* [#15280](https://bugzilla.scilab.org/15280): `gsort` was unable to sort any hypermatrix along dimensions > "r"|"c".
* Copyright (C) INRIA
* Copyright (C) 2009 - DIGITEO - Pierre Lando
* Copyright (C) 2010 - DIGITEO - Yann Collette
- *
* Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
*
* 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.
<refsynopsisdiv>
<title>Syntax</title>
<synopsis>
- plot2d([logflag,][x,],y[,style[,strf[,leg[,rect[,nax]]]]])
- plot2d([logflag,][x,],y,<opt_args>)
+ plot2d() // example
+ plot2d(y)
+ plot2d(x, y)
+ plot2d(logflag, x, y)
+ plot2d(.., y, style)
+ plot2d(.., y, style, strf)
+ plot2d(.., y, style, strf, leg)
+ plot2d(.., y, style, strf, leg, rect)
+ plot2d(.., y, style, strf, leg, rect, nax)
+ plot2d(.., y, key1=value1, key2=value2, ..)
</synopsis>
</refsynopsisdiv>
- <refsection role="parameters">
+ <refsection role="arguments">
<title>Arguments</title>
<variablelist>
<varlistentry>
<term>x</term>
<listitem>
- <para>a real matrix or vector. If omitted, it is assumed to be the
- vector <literal>1:n</literal> where <literal>n</literal> is the
- number of curve points given by the <literal>y</literal>
- parameter.
- </para>
+ a real matrix or vector of abscissae. If omitted, abscissae are assumed to
+ be <literal>1:n</literal> for all curves, where <literal>n</literal> is the
+ number of points in curves, as given by <varname>y</varname>.
+ <para/>
</listitem>
</varlistentry>
<varlistentry>
<term>y</term>
<listitem>
- <para>a real matrix or vector.</para>
+ real matrix or vector: Ordinates
+ <para/>
</listitem>
</varlistentry>
<varlistentry>
- <term><opt_args></term>
+ <term>key1=value1, key2=value2, ...</term>
<listitem>
- <para>This represents a sequence of statements
- <literal>key1=value1,key2=value2</literal>,... where
- <literal>key1</literal>, <literal>key2,...</literal> can be one of
- the following:
+ <para>
+ The following options <varname>logflag</varname>, <varname>style</varname>,
+ <varname>strf</varname>, <varname>leg</varname>, <varname>rect</varname>,
+ <varname>nax</varname>, <varname>frameflag</varname>, and
+ <varname>axesflag</varname> described below can either be listed in the
+ right order as listed in the synopses, or provided in any order after
+ <varname>y</varname> as named arguments, for instance like in
+ <literal>plot(y, frameflag=3, leg="Curve 1@Curve 2")</literal>.
</para>
- <variablelist>
- <varlistentry>
- <term>logflag</term>
- <listitem>
- <para>sets the scale (linear or logarithmic) along the axes.
- The associated value should be a string with possible
- values: <literal>"nn"</literal>, <literal>"nl"</literal> ,
- <literal>"ln"</literal> and <literal>"ll"</literal> .
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>style</term>
- <listitem>
- <para>sets the style for each curve. The associated value
- should be a real vector with integer (positive or negative)
- values.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>strf</term>
- <listitem>
- <para>controls the display of captions.</para>
- <para>
- <literal>strf</literal> is a string of length 3
- <literal>"xyz"</literal> (by default <literal>strf=
- "081"
- </literal>
- )
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>leg</term>
- <listitem>
- <para>sets the curves captions. The associated value should be
- a character string.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>rect</term>
- <listitem>
- <para>sets the minimal bounds requested for the plot. The
- associated value should be a real vector with four entries:
- <literal>[xmin,ymin,xmax,ymax]</literal>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>nax</term>
- <listitem>
- <para>sets the axes labels and tics definition. The associated
- value should be a real vector with four integer entries
- <literal>[nx,Nx,ny,Ny].</literal>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag</term>
- <listitem>
- <para>controls the computation of the actual coordinate ranges
- from the minimal requested values. The associated value should
- be an integer ranging from 0 to 8.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag</term>
- <listitem>
- <para>specifies how the axes are drawn. The associated value
- should be an integer ranging from 0 to 5 or 9 (default value).
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
</listitem>
</varlistentry>
- </variablelist>
- </refsection>
- <refsection role="description">
- <title>Description</title>
- <para>
- <literal>plot2d</literal> plots a set of 2D curves. If you are
- familiar with Matlab <literal>plot</literal> syntax, you should use <link linkend="plot">plot</link>.
- </para>
- <para>
- If <literal>x</literal> and <literal>y</literal> are vectors,
- plot2d(x,y,<opt_args>) plots vector <literal>y</literal> versus
- vector <literal>x</literal>. <literal>x</literal> and <literal>y</literal>
- vectors should have the same number of entries.
- </para>
- <para>
- If <literal>x</literal> is a vector and <literal>y</literal> a
- matrix plot2d(x,y,<opt_args>) plots each columns of
- <literal>y</literal> versus vector <literal>x</literal>. The
- number of rows of <literal>y</literal> must be equal to the number of
- <literal>x</literal> entries.
- </para>
- <para>
- If <literal>x</literal> and <literal>y</literal> are matrices,
- plot2d(x,y,<opt_args>) plots each columns of <literal>y</literal>
- versus corresponding column of <literal>x</literal>.
- <literal>x</literal> and <literal>y</literal> must then have the same sizes.
- </para>
- <para>
- If <literal>y</literal> is a vector, plot2d(y,<opt_args>)
- plots vector <literal>y</literal> versus vector
- <literal>1:size(y,'*')</literal>.
- </para>
- <para>
- If <literal>y</literal> is a matrix, plot2d(y,<opt_args>)
- plots each columns of <literal>y</literal> versus vector
- <literal>1:size(y,1)</literal>.
- </para>
- <para>
- The <literal><opt_args></literal> arguments should be used to
- customize the plot
- </para>
- <variablelist>
<varlistentry>
<term>logflag</term>
<listitem>
- <para>This option may be used to set the scale (linear or
- logarithmic) along the axes. The associated value should be a
- string with possible values: <literal>"nn"</literal>,
- <literal>"nl"</literal> , <literal>"ln"</literal> and
- <literal>"ll"</literal>. <literal>"l"</literal> stands for
- logarithmic scale and graduations and <literal>"n"</literal> for
- normal scale.
+ <para>
+ Sets the linear or logarithmic scale for both X and Y axes.
+ Possible values are <literal>"nn"</literal>, <literal>"nl"</literal> ,
+ <literal>"ln"</literal> or <literal>"ll"</literal>.
+ <literal>"n"</literal> stands for
+ <emphasis role="bold">n</emphasis>ormal scale ;
+ <literal>"l"</literal> stands for
+ <emphasis role="bold">l</emphasis>ogarithmic.
+ The first letter set the X axis. The second one sets the Y axis.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>style</term>
<listitem>
- <para>This option may be used to specify how the curves are drawn.
- If this option is specified, the associated value should be a vector
- with as many entries as curves.
+ <para>
+ Sets the respective line or mark styles of the curves.
+ It is a vector of decimal integers with one element per curve:
</para>
<itemizedlist>
<listitem>
- <para>
- if <literal>style(i)</literal> is strictly positive, the
- curve is drawn as plain line and <literal>style(i)</literal>
- defines the index of the color used to draw the curve (see <link linkend="getcolor">getcolor</link>). Note that the line style
- and the thickness can be set through the polyline entity
- properties (see <link linkend="polyline_properties">polyline_properties</link>).
- </para>
- <para>Piecewise linear interpolation is done between the given
- curve points.
- </para>
+ if <literal>style(i)</literal> is strictly positive, the
+ curve is drawn as plain line and <literal>style(i)</literal>
+ defines the index of the color used to draw the curve
+ (see <link linkend="getcolor">getcolor</link>).
</listitem>
<listitem>
- <para>
- if <literal>style(i)</literal> is negative or zero, the
- given curve points are drawn using marks,
- <literal>abs(style(i))</literal> defines the mark with id used.
- Note that the marks color and marks sizes can be set through
- the polyline entity properties (see <link linkend="polyline_properties">polyline_properties</link>).
- </para>
+ if <literal>style(i)</literal> is negative or zero, the
+ given curve points are drawn using marks. Then
+ <literal>abs(style(i))</literal> is the mark's id.
+ <para/>
</listitem>
</itemizedlist>
+ <para>
+ Note that all curves properties -- like also their color,
+ thickness, marks colors, etc -- can be set through their handles
+ (see <link linkend="polyline_properties">polyline_properties</link>).
+ </para>
</listitem>
</varlistentry>
<varlistentry>
<term>strf</term>
<listitem>
- <para>
- is a string of length 3 <literal>"xyz"</literal> (by default
- <literal>strf= "081"</literal>)
- </para>
- <variablelist>
- <varlistentry>
- <term>x</term>
- <listitem>
- <para>controls the display of captions.</para>
- <variablelist>
- <varlistentry>
- <term>x=0</term>
- <listitem>
- <para>no caption.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>x=1</term>
- <listitem>
- <para>captions are displayed. They are given by the
- optional argument <literal>leg</literal>.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y</term>
- <listitem>
- <para>controls the computation of the actual coordinate ranges
- from the minimal requested values. Actual ranges can be larger
- than minimal requirements.
- </para>
- <variablelist>
- <varlistentry>
- <term>y=0</term>
- <listitem>
- <para>no computation, the plot use the previous (or
- default) scale
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=1</term>
- <listitem>
- <para>from the rect arg</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=2</term>
- <listitem>
- <para>from the min/max of the x, y data</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=3</term>
- <listitem>
- <para>built for an isometric scale from the rect
- arg
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=4</term>
- <listitem>
- <para>built for an isometric plot from the min/max of
- the x, y data
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=5</term>
- <listitem>
- <para>enlarged for pretty axes from the rect arg</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=6</term>
- <listitem>
- <para>enlarged for pretty axes from the min/max of the
- x, y data
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=7</term>
- <listitem>
- <para>like y=1 but the previous plot(s) are redrawn to
- use the new scale
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=8</term>
- <listitem>
- <para>like y=2 but the previous plot(s) are redrawn to
- use the new scale
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>z</term>
- <listitem>
- <para>controls the display of information on the frame around
- the plot. If axes are requested, the number of tics can be
- specified by the <literal>nax</literal> optional
- argument.
- </para>
- <variablelist>
- <varlistentry>
- <term>z=0</term>
- <listitem>
- <para>nothing is drawn around the plot.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>z=1</term>
- <listitem>
- <para>axes are drawn, the y=axis is displayed on the
- left.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>z=2</term>
- <listitem>
- <para>the plot is surrounded by a box without
- tics.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>z=3</term>
- <listitem>
- <para>axes are drawn, the y=axis is displayed on the
- right.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>z=4</term>
- <listitem>
- <para>axes are drawn centred in the middle of the frame
- box.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>z=5</term>
- <listitem>
- <para>axes are drawn so as to cross at point
- <literal>(0,0)</literal>. If point
- <literal>(0,0)</literal> does not lie inside the frame,
- axes will not appear on the graph.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </listitem>
- </varlistentry>
- </variablelist>
+ 3-character-long string <literal>"abc"</literal> specifying all
+ together if legends must be displayed, and the values of
+ <varname>frameflag</varname> and <varname>axesflag</varname>.
+ By default, <literal>strf= "081"</literal>. "a", "b" and "c" are:
+ <para/>
+ <table>
+ <tr><th>a :</th>
+ <td>controls the display of captions:
+ <table>
+ <tr><th>x=0 :</th><td>no caption.</td></tr>
+ <tr><th>x=1 :</th>
+ <td>captions given by the optional argument
+ <varname>leg</varname> are displayed.</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr><th>b :</th>
+ <td>
+ <varname>frameflag</varname> integer code in [0,9],
+ controlling the computation the actual coordinate ranges,
+ as described below.
+ </td>
+ </tr>
+ <tr><th>c :</th>
+ <td>
+ <varname>axesflag</varname> integer code in [0:5 9],
+ controlling the display and position of X and Y axes,
+ as described below.
+ </td>
+ </tr>
+ </table>
+ <para/>
</listitem>
</varlistentry>
<varlistentry>
<term>leg</term>
<listitem>
- <para>This option may be used to sets the curve captions. It must be
- a string with the form <literal>"leg1@leg2@...."</literal> where
- <literal>leg1</literal> , <literal>leg2</literal> , etc. are
- respectively the captions of the first curve, of the second curve,
- etc. The default is <literal> " "</literal>.
+ <para>
+ Single string <literal>"leg1@leg2@...."</literal> setting
+ the legends leg1, leg2, etc for the respective curves #1, #2,
+ etc. The default is <literal> " "</literal>. The block
+ of legends is drawn on the bottom, below the x-axis.
</para>
- <para>The curve captions are drawn on below the x-axis. This option
- is not flexible enough, use the <link linkend="captions">captions</link> or <link linkend="legend">legend</link> functions preferably.
+ <para>
+ After plotting, the handle of the block of legends can be
+ retrieved with <literal>gca().children(2)</literal>.
+ <link linkend="captions">captions</link>,
+ <link linkend="legend">legend</link> or
+ <link linkend="legends">legends</link> can also be used
+ instead of <varname>leg</varname>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>rect</term>
<listitem>
- <para>This option may be used to set the minimal bounds requested
- for the plot. If this option is specified, the associated value
- should be a real vector with four entries:
- </para>
<para>
- <literal>[xmin,ymin,xmax,ymax]</literal>.
- <literal>xmin</literal> and <literal>xmax</literal> defines the
- bounds on the abscissae while <literal>ymin</literal> and
- <literal>ymax</literal> defines the bounds on the ordinates.
+ Vector of decimal numbers <literal>[xmin, ymin, xmax, ymax]</literal>
+ setting the minimal bounds requested for the plot.
+ <literal>[xmin, xmax]</literal> is the X-axis range, and
+ <literal>[ymin, ymax]</literal> is the Y-axis one.
</para>
- <para>This argument may be used together with the
- <literal>frameflag</literal> option to specify how the axes
- boundaries are derived from the given <literal>rect</literal>
- argument. If the <literal>frameflag</literal> option is not given,
+ <para>
+ This argument works with the <varname>frameflag</varname>
+ option to specify how the actual axes boundaries are computed.
+ If the <varname>frameflag</varname> option is not given,
it is supposed to be <literal>frameflag=7</literal>.
</para>
- <para>The axes boundaries can also be customized through the axes
- entity properties (see <link linkend="axes_properties">axes_properties</link>).
+ <para>
+ The axes boundaries can also be customized through the
+ <literal>gca().data_bounds</literal> property of the axes
+ (see <link linkend="axes_properties">axes_properties</link>).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>nax</term>
<listitem>
- <para>This option may be used to specify the axes labels and tics
- definition. The associated value should be a real vector with four integer entries
- <literal>[nx,Nx,ny,Ny]</literal>.
- </para>
<para>
- <literal>Nx</literal> gives the number of main tics to be used
- on the x-axis (to use autoticks set it to -1), <literal>nx</literal> gives the number of
- subtics to be drawn between two main x-axis tics.
+ Vector of decimal integers <literal>[nx,Nx,ny,Ny]</literal>
+ specifying the numbers Nx and Ny of major ticks, and the
+ numbers nx and ny of minor ticks between 2 majors, for both
+ respective axes. To use autoticking on an axis, set Nx=-1 or Ny=-1.
</para>
<para>
- <literal>Ny</literal> and <literal>ny</literal> give similar
- information for the y-axis.
- </para>
- <para>
- If <literal>axesflag</literal> option is not set
- <literal>nax</literal> option supposes that
- <literal>axesflag</literal> option has been set to 9.
+ If the <varname>axesflag</varname> option is not specified,
+ using <varname>nax</varname> sets and uses
+ <literal>axesflag=9</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>frameflag</term>
<listitem>
- <para>This option may be used to control the computation of the
- actual coordinate ranges from the minimal requested values. Actual
- ranges can be larger than minimal requirements.
+ <para>controls the computation of the actual coordinate ranges
+ from the minimal requested values. The associated value should
+ be an integer ranging from 0 to 8.
+ </para>
+ <para>
+ <table border="1" cellpadding="1" cellspacing="0">
+ <tr><th>frameflag</th><th>axes bounds</th> <th>other actions</th></tr>
+ <tr align="center">
+ <th>0</th> <td>unchanged</td> <td></td></tr>
+ <tr align="center">
+ <th>1</th> <td>from rect</td> <td></td></tr>
+ <tr align="center">
+ <th>2</th> <td>from input x,y</td> <td></td></tr>
+ <tr align="center">
+ <th>3</th> <td>from rect</td> <td>isometric axes</td></tr>
+ <tr align="center">
+ <th>4</th> <td>from input x,y</td> <td>isometric axes</td></tr>
+ <tr align="center">
+ <th>5</th> <td>from rect</td> <td>pretty axes</td></tr>
+ <tr align="center">
+ <th>6</th> <td>from input x,y</td> <td>pretty axes</td></tr>
+ <tr align="center">
+ <th>7</th> <td>from rect</td> <td>all replot with new scales</td></tr>
+ <tr align="center">
+ <th>8</th> <td>from input x,y</td> <td>all replot with new scales</td></tr>
+ <tr align="center">
+ <th>9</th> <td>from input x,y</td> <td>Pretty axes. All replot with new scales</td></tr>
+ </table>
</para>
- <variablelist>
- <varlistentry>
- <term>frameflag=0</term>
- <listitem>
- <para>no computation, the plot use the previous (or default)
- scale.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=1</term>
- <listitem>
- <para>The actual range is the range given by the
- <literal>rect</literal> option.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=2</term>
- <listitem>
- <para>The actual range is computed from the min/max of the
- <literal>x</literal> and <literal>y</literal> data.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=3</term>
- <listitem>
- <para>The actual range is the range given by the
- <literal>rect</literal> option and enlarged to get an
- isometric scale.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=4</term>
- <listitem>
- <para>The actual range is computed from the min/max of the
- <literal>x</literal> and <literal>y</literal> data and
- enlarged to get an isometric scale.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=5</term>
- <listitem>
- <para>The actual range is the range given by the
- <literal>rect</literal> option and enlarged to get pretty axes
- labels.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=6</term>
- <listitem>
- <para>The actual range is computed from the min/max of the
- <literal>x</literal> and <literal>y</literal> data and
- enlarged to get pretty axes labels.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=7</term>
- <listitem>
- <para>
- like <literal>frameflag=1</literal> but the previous
- plot(s) are redrawn to use the new scale. Used to add the
- current graph to a previous one.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=8</term>
- <listitem>
- <para>
- like<literal>frameflag=2</literal> but the previous
- plot(s) are redrawn to use the new scale. Used to add the
- current graph to a previous one.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=9</term>
- <listitem>
- <para>
- like<literal>frameflag=8</literal> but the range is
- enlarged to get pretty axes labels. This is the default
- value.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para>The axes boundaries can also be customized through the axes
- entity properties (see <link linkend="axes_properties">axes_properties</link>)
+ <para>
+ The setting of axes boundaries can also be customized through
+ the <literal>gca().data_bounds</literal>,
+ <literal>gca().tight_limits</literal>,
+ <literal>gca().data_bounds</literal>, and
+ <literal>gca().isoview</literal> properties
+ (see <link linkend="axes_properties">axes_properties</link>).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>axesflag</term>
<listitem>
- <para>This option may be used to specify how the axes are drawn. The
- associated value should be an integer ranging from 0 to 5 :
+ <para>
+ integer code in [0:5 9], controlling the display and position of
+ X and Y axes.
</para>
- <variablelist>
- <varlistentry>
- <term>axesflag=0</term>
- <listitem>
- <para>nothing is drawn around the plot (axes_visible=["off"
- "off"];box="off").
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag=1</term>
- <listitem>
- <para>axes are drawn, the y-axis is displayed on the left
- (axes_visible=["on" "on"];box="on",y_location="left").
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag=2</term>
- <listitem>
- <para>the plot is surrounded by a box without tics
- (axes_visible=["off" "off"];box="on").
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag=3</term>
- <listitem>
- <para>axes are drawn, the y-axis is displayed on the
- right (axes_visible=["on"
- "on"];box="off",y_location="right").
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag=4</term>
- <listitem>
- <para>axes are drawn centered in the middle of the frame, the box
- being not drawn (axes_visible=["on" "on"];box="off",x_location="middle",
- y_location="middle").
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag=5</term>
- <listitem>
- <para>axes are drawn centered in the middle of the frame similarly to
- <literal>axesflag=4</literal>, the difference being that the box is drawn
- (axes_visible=["on" "on"];box="on",x_location="middle",y_location="middle").
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag=9</term>
- <listitem>
- <para>axes are drawn, the y-axis is displayed on the left
- (axes_visible=["on" "on"];box="off",y_location="left"). This
- is the default value.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para>The axes aspect can also be customized through the axes
- entity properties (see <link linkend="axes_properties">axes_properties</link>).
+ <para>
+ The axes aspect can also be customized directly through the
+ <literal>gca().box</literal>, <literal>gca().axes_visible</literal>,
+ <literal>gca().x_location</literal>, and <literal>gca().y_location</literal>,
+ properties (see <link linkend="axes_properties">axes_properties</link>).
</para>
+ <table border="1" cellpadding="1">
+ <tr><th>axesFlag</th><th>.box</th><th>.axes_visible</th><th>axes position</th><th>comments</th></tr>
+ <tr align="center">
+ <th>0</th><td>"off"</td><td>["off" "off"]</td><td></td> <td>Naked plot</td></tr>
+ <tr align="center">
+ <th>1</th><td>"on"</td> <td>["on" "on"]</td> <td></td> <td></td></tr>
+ <tr align="center">
+ <th>2</th><td>"on"</td> <td>["off" "off"]</td><td></td> <td>Naked box</td></tr>
+ <tr align="center">
+ <th>3</th><td>"off"</td><td>["on" "on"]</td> <td>y_location="right"</td><td></td></tr>
+ <tr align="center">
+ <th>4</th><td>"off"</td><td>["on" "on"]</td> <td>crossed @ middle</td><td></td></tr>
+ <tr align="center">
+ <th>5</th><td>"on"</td> <td>["on" "on"]</td> <td>crossed @ middle</td><td></td></tr>
+ <tr align="center">
+ <th>9</th><td>"off"</td><td>["on" "on"]</td> <td></td> <td>(default setting)</td></tr>
+ </table>
</listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection role="description">
- <title>More information</title>
- <para>By default, successive plots are superposed. To clear the previous plot, use
- <literal>
- <link linkend="clf">clf()</link>
- </literal>
- .
+ <title>Description</title>
+ <para>
+ <literal>plot2d</literal> plots a set of 2D curves. Piecewise linear interpolation
+ is done between the given curve points.
+ </para>
+ <para>
+ Any point with <literal>y(i)=Nan</literal> is masked: no mark and no segment to its
+ neighboors are displayed.
+ </para>
+ <para>
+ For any point with <literal>y(i)=±Inf</literal>, a vertical segment starting
+ from each of its both neighboors is drawn in the ± direction, up to the current ceil
+ or down to the current floor of the axes.
+ </para>
+ <para>
+ By default, successive calls to plot2d() overplots new curves over existing ones.
+ Autoclearing for each new plot can be set using <literal>gca().auto_clear="on"</literal>.
+ Please see <link linkend="axes_properties">axes properties</link>.
+ <literal><link linkend="clf">clf</link></literal> can also be used to manually clear
+ the whole figure.
+ </para>
+ <para>
+ If you are familiar with Matlab <literal>plot</literal> syntax, you should use
+ <link linkend="plot">plot</link> instead.
+ </para>
+ <para>
+ If <literal>x</literal> and <literal>y</literal> are vectors,
+ plot2d(x,y,…) plots vector <literal>y</literal> versus
+ vector <literal>x</literal>. <literal>x</literal> and <literal>y</literal>
+ vectors should have the same number of entries.
+ </para>
+ <para>
+ If <literal>x</literal> is a vector and <literal>y</literal> a
+ matrix plot2d(x,y,…) plots each columns of
+ <literal>y</literal> versus vector <literal>x</literal>. The
+ number of rows of <literal>y</literal> must be equal to the number of
+ <literal>x</literal> entries.
+ </para>
+ <para>
+ If <literal>x</literal> and <literal>y</literal> are matrices,
+ plot2d(x,y,…) plots each columns of <literal>y</literal>
+ versus corresponding column of <literal>x</literal>.
+ <literal>x</literal> and <literal>y</literal> must then have the same sizes.
+ </para>
+ <para>
+ If <literal>y</literal> is a vector, plot2d(y,…)
+ plots vector <literal>y</literal> versus vector
+ <literal>1:size(y,'*')</literal>.
+ </para>
+ <para>
+ If <literal>y</literal> is a matrix, plot2d(y,…)
+ plots each columns of <literal>y</literal> versus vector
+ <literal>1:size(y,1)</literal>.
</para>
<para>
Enter the command <literal>plot2d()</literal> to see a demo.
<link linkend="plot">plot</link>
</member>
<member>
+ <link linkend="polyline_properties">.polyline_style</link>
+ </member>
+ <member>
<link linkend="plot2d2">plot2d2</link>
</member>
<member>
<link linkend="plot2d4">plot2d4</link>
</member>
<member>
- <link linkend="clf">clf</link>
+ <link linkend="polarplot">polarplot</link>
</member>
<member>
- <link linkend="xdel">xdel</link>
+ <link linkend="gca">gca</link>
</member>
<member>
- <link linkend="delete">delete</link>
+ <link linkend="axes_properties">axes_properties</link>
+ </member>
+ <member>
+ <link linkend="clf">clf</link>
</member>
</simplelist>
</refsection>
* Copyright (C) INRIA
* Copyright (C) 2009 - DIGITEO - Pierre Lando
* Copyright (C) 2010 - DIGITEO - Yann Collette
- *
* Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
*
* 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.
<refsynopsisdiv>
<title>呼び出し手順</title>
<synopsis>
- plot2d([logflag,][x,],y[,style[,strf[,leg[,rect[,nax]]]]])
- plot2d([logflag,][x,],y,<opt_args>)
+ plot2d() // example
+ plot2d(y)
+ plot2d(x, y)
+ plot2d(logflag, x, y)
+ plot2d(.., y, style)
+ plot2d(.., y, style, strf)
+ plot2d(.., y, style, strf, leg)
+ plot2d(.., y, style, strf, leg, rect)
+ plot2d(.., y, style, strf, leg, rect, nax)
+ plot2d(.., y, key1=value1, key2=value2, ..)
</synopsis>
</refsynopsisdiv>
<refsection role="parameters">
</listitem>
</varlistentry>
<varlistentry>
- <term><opt_args></term>
+ <term>key1=value1, key2=value2, ...</term>
<listitem>
<para>
- 一連の命令 <literal>key1=value1,key2=value2</literal>,...
- を表します.
- ただし, <literal>key1</literal>, <literal>key2,...</literal>
- には以下のどれかを指定できます:
+ The following options <varname>logflag</varname>, <varname>style</varname>,
+ <varname>strf</varname>, <varname>leg</varname>, <varname>rect</varname>,
+ <varname>nax</varname>, <varname>frameflag</varname>, and
+ <varname>axesflag</varname> described below can either be listed in the
+ right order as listed in the synopses, or provided in any order after
+ <varname>y</varname> as named arguments, for instance like in
+ <literal>plot(y, frameflag=3, leg="Curve 1@Curve 2")</literal>.
</para>
- <variablelist>
- <varlistentry>
- <term>logflag</term>
- <listitem>
- <para>
- 軸スケール (線形または対数)を設定します.
- 値は文字列で, 以下の値のどれかを指定します:
- <literal>"nn"</literal>, <literal>"nl"</literal> ,
- <literal>"ln"</literal> および <literal>"ll"</literal> .
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>style</term>
- に
- <listitem>
- <para>各曲線のスタイルを設定します.
- 値は整数値(正または負)を有する実数ベクトルを指定します.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>strf</term>
- <listitem>
- <para>凡例の表示を制御します.</para>
- <para>
- <literal>strf</literal> は長さ3の文字列
- <literal>"xyz"</literal>です.
- (デフォルトでは,<literal>strf="081"</literal>)
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>leg</term>
- <listitem>
- <para>曲線の凡例を設定します.
- 値には文字列を指定します.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>rect</term>
- <listitem>
- <para>
- プロットに使用する最小限の領域を設定します.
- 値には以下の4個のエントリを有する実数ベクトルを指定します:
- <literal>[xmin,ymin,xmax,ymax]</literal>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>nax</term>
- <listitem>
- <para>軸ラベルと目盛の定義を設定します.
- 値には4個の整数エントリ<literal>[nx,Nx,ny,Ny]</literal>を有する
- 実数ベクトルを指定します.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag</term>
- <listitem>
- <para>指定された最小限の領域に基づく実際の座標系の範囲の
- 計算を制御します.
- 値には, 0 から 8までの範囲の整数を指定します.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag</term>
- <listitem>
- <para>軸の描画方法を指定します. 値には,
- 0 から 5までの範囲の整数を指定します.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
</listitem>
</varlistentry>
- </variablelist>
- </refsection>
- <refsection role="description">
- <title>説明</title>
- <para>
- <literal>plot2d</literal> は一連の2次元曲線をプロットします.
- Matlabの<literal>plot</literal>構文に慣れている場合には,
- <link linkend="plot">plot</link>を使用するべきです.
- </para>
- <para>
- <literal>x</literal> および <literal>y</literal> がベクトルの場合,
- plot2d(x,y,<opt_args>) はベクトル <literal>y</literal> を
- ベクトル <literal>x</literal>に対してプロットします.
- ベクトル<literal>x</literal> および <literal>y</literal>は
- 同じ数のエントリを有する必要があります.
- </para>
- <para>
- <literal>x</literal> がベクトルで <literal>y</literal> が行列の場合,
- plot2d(x,y,<opt_args>) は<literal>y</literal>の各列を
- ベクトル<literal>x</literal>に対してプロットします.
- この場合,<literal>y</literal>の列の数は<literal>x</literal>
- のエントリの数に等しい必要があります.
- </para>
- <para>
- <literal>x</literal> および <literal>y</literal> が行列の場合,
- plot2d(x,y,<opt_args>) は<literal>y</literal>の各列を
- 対応する<literal>x</literal>の列に対してプロットします.
- この場合,<literal>x</literal> と<literal>y</literal>の
- 大きさは同じである必要があります.
- </para>
- <para>
- <literal>y</literal> がベクトルの場合, plot2d(y,<opt_args>)
- はベクトル <literal>y</literal> をベクトル
- <literal>1:size(y,'*')</literal>に対してプロットします.
- </para>
- <para>
- <literal>y</literal> が行列の場合, plot2d(y,<opt_args>)
- は<literal>y</literal>の各列をベクトル
- <literal>1:size(y,1)</literal>に対してプロットします.
- </para>
- <para>
- プロットをカスタマイズするために引数<literal><opt_args></literal> を
- 使用することができます.
- </para>
- <variablelist>
<varlistentry>
<term>logflag</term>
<listitem>
- <para>このオプションは,
- 軸スケール (線形または対数)を設定守るために使用できます.
- 値は文字列で, 以下の値のどれかを指定します:
- <literal>"nn"</literal>,
- <literal>"nl"</literal> , <literal>"ln"</literal> および
- <literal>"ll"</literal>. <literal>"l"</literal> は
- 対数軸/目盛, <literal>"n"</literal>は通常の軸を意味します.
+ <para>
+ Sets the linear or logarithmic scale for both X and Y axes.
+ Possible values are <literal>"nn"</literal>, <literal>"nl"</literal> ,
+ <literal>"ln"</literal> or <literal>"ll"</literal>.
+ <literal>"n"</literal> stands for
+ <emphasis role="bold">n</emphasis>ormal scale ;
+ <literal>"l"</literal> stands for
+ <emphasis role="bold">l</emphasis>ogarithmic.
+ The first letter set the X axis. The second one sets the Y axis.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>style</term>
+ に
<listitem>
- <para>
- このオプションは,曲線の描画方法を指定する際に使用できます.
- このオプションを指定する場合,
- 値には曲線と同じ数のエントリを有するベクトルを指定します.
+ <para>各曲線のスタイルを設定します.
+ 値は整数値(正または負)を有する実数ベクトルを指定します.
+ 値には曲線と同じ数のエントリを有するベクトルを指定します.
</para>
<itemizedlist>
<listitem>
(<link linkend="polyline_properties">polyline_properties</link>参照)
により設定することができることに注意してください.
</para>
- <para>指定した曲線の点の間は区分線形補間が行われます.</para>
</listitem>
<listitem>
<para>
</para>
</listitem>
</itemizedlist>
+ <para/>
</listitem>
</varlistentry>
<varlistentry>
<term>strf</term>
<listitem>
- <para>
- 長さ <literal>"xyz"</literal> (デフォルトで
- <literal>strf= "081"</literal>)の文字列.
- </para>
- <variablelist>
- <varlistentry>
- <term>x</term>
- <listitem>
- <para>凡例の表示を制御します.</para>
- <variablelist>
- <varlistentry>
- <term>x=0</term>
- <listitem>
- <para>凡例なし.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>x=1</term>
- <listitem>
- <para>凡例が表示されます.凡例は,
- オプションの引数 <literal>leg</literal>で指定されます.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y</term>
- <listitem>
- <para>指定した最小限の範囲に基づく実際の座標系の範囲の計算を
- 制御します. 実際の範囲は指定した最小限の範囲よりも大きくすることができます.
- </para>
- <variablelist>
- <varlistentry>
- <term>y=0</term>
- <listitem>
- <para>
- 計算せずに,以前のスケール(またはデフォルト)を
- プロットに使用します
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=1</term>
- <listitem>
- <para>rect引数による</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=2</term>
- <listitem>
- <para>x, y データの最小値/最大値による</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=3</term>
- <listitem>
- <para>rect引数に基づき等軸スケールで構築</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=4</term>
- <listitem>
- <para>
- x, y データの最小値/最大値に基づき等軸スケールで構築
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=5</term>
- <listitem>
- <para>rect引数に基づき見栄え良く軸を拡大</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=6</term>
- <listitem>
- <para>
- x, y データの最小値/最大値に基づき見栄え良く軸を拡大
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=7</term>
- <listitem>
- <para>y=1に似ていますが,
- 前のプロットが新しいスケールを用いて再描画されます
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=8</term>
- <listitem>
- <para>y=2に似ていますが,
- 前のプロットが新しいスケールを用いて再描画されます
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>z</term>
- <listitem>
- <para>
- プロットの周囲のフレームへの情報の表示を制御します.
- 軸が指定された場合,目盛の数をオプションの引数
- <literal>nax</literal>により指定できます.
- </para>
- <variablelist>
- <varlistentry>
- <term>z=0</term>
- <listitem>
- <para>プロットの周囲に何も描画されません.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>z=1</term>
- <listitem>
- <para>軸が描画され, y軸が左に表示されます.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>z=2</term>
- <listitem>
- <para>プロットが目盛のない箱で囲まれます.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>z=3</term>
- <listitem>
- <para>軸が描画され, y軸が右に表示されます.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>z=4</term>
- <listitem>
- <para>
- フレームボックスの中心に軸が描画されます.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>z=5</term>
- <listitem>
- <para>
- 点<literal>(0,0)</literal>で交差するように
- 軸が描画されます.
- 点<literal>(0,0)</literal>がフレーム内にない場合,
- グラフ上に軸は表示されません.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </listitem>
- </varlistentry>
- </variablelist>
+ 3-character-long string <literal>"abc"</literal> specifying all
+ together if legends must be displayed, and the values of
+ <varname>frameflag</varname> and <varname>axesflag</varname>.
+ By default, <literal>strf= "081"</literal>. "a", "b" and "c" are:
+ <para/>
+ <table>
+ <tr><th>a :</th>
+ <td>凡例の表示を制御します.
+ <table>
+ <tr><th>x=0 :</th><td>凡例なし.</td></tr>
+ <tr><th>x=1 :</th>
+ <td>凡例が表示されます.凡例は,
+ オプションの引数 <varname>leg</varname>で指定されます.
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr><th>b :</th>
+ <td>
+ <varname>frameflag</varname> integer code in [0,9],
+ controlling the computation the actual coordinate ranges,
+ as described below.
+ </td>
+ </tr>
+ <tr><th>c :</th>
+ <td>
+ <varname>axesflag</varname> integer code in [0:5 9],
+ controlling the display and position of X and Y axes,
+ as described below.
+ </td>
+ </tr>
+ </table>
+ <para/>
</listitem>
</varlistentry>
<varlistentry>
必要があります.
ただし, <literal>leg1</literal> , <literal>leg2</literal> , ...
はそれぞれ最初の曲線,2番目の曲線,... の凡例です.
+ 曲線の凡例はx軸の下に描画されます.
デフォルトは
<literal> " "</literal>です.
</para>
- <para>曲線の凡例はx軸の下に描画されます.
- このオプションは柔軟ではないため,なるべく,
- <link linkend="captions">captions</link> または <link linkend="legend">legend</link> 関数を使用してください.
+ <para>
+ After plotting, the handle of the block of legends can be
+ retrieved with <literal>gca().children(2)</literal>.
+ <link linkend="captions">captions</link>,
+ <link linkend="legend">legend</link> or
+ <link linkend="legends">legends</link> can also be used
+ instead of <varname>leg</varname>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>frameflag</term>
<listitem>
- <para>このオプションは指定された最小限の範囲に基づく実際の
- 座標系範囲の計算を制御するために使用できます.
- 実際の範囲は指定された最小限の範囲よりも大きくすることができます.
+ <para>controls the computation of the actual coordinate ranges
+ from the minimal requested values. The associated value should
+ be an integer ranging from 0 to 8.
</para>
- <variablelist>
- <varlistentry>
- <term>frameflag=0</term>
- <listitem>
- <para>計算せずに,以前のスケール(またはデフォルト)を
- プロットに使用します.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=1</term>
- <listitem>
- <para>実際の範囲は
- <literal>rect</literal> オプションにより指定された範囲となります.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=2</term>
- <listitem>
- <para>実際の範囲は
- <literal>x</literal> および<literal>y</literal> データの最小値/最大値から
- 計算されます.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=3</term>
- <listitem>
- <para>
- 実際の範囲は<literal>rect</literal>オプションにより指定された範囲となり,
- 等軸スケールにするために拡大されます.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=4</term>
- <listitem>
- <para>実際の範囲は
- <literal>x</literal> および<literal>y</literal> データの最小値/最大値から
- 計算され,等軸スケールにするために拡大されます.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=5</term>
- <listitem>
- <para>
- 実際の範囲は<literal>rect</literal>オプションにより指定された範囲となり,
- 軸ラベルの見栄えを良くするために拡大されます.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=6</term>
- <listitem>
- <para>実際の範囲は
- <literal>x</literal> および<literal>y</literal> データの最小値/最大値から
- 計算され,軸ラベルの見栄えを良くするために拡大されます.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=7</term>
- <listitem>
- <para>
- <literal>frameflag=1</literal>と似ていますが,
- 前のプロットが新しいスケールを用いて再描画されます.
- カレントのグラフに前のプロットを追加するために使用されます.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=8</term>
- <listitem>
- <para>
- <literal>frameflag=2</literal>と似ていますが,
- 前のプロットが新しいスケールを用いて再描画されます.
- カレントのグラフに前のプロットを追加するために使用されます.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=9</term>
- <listitem>
- <para>
- <literal>frameflag=8</literal> と似ていますが,
- 範囲は軸ラベルの見栄えを良くするために拡大されます.
- これはデフォルト値です.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para>軸の境界も軸エンティティプロパティによりカスタマイズできます
- (s<link linkend="axes_properties">axes_properties</link>参照).
+ <para>
+ <table border="1" cellpadding="1" cellspacing="0">
+ <tr><th>frameflag</th><th>axes bounds</th> <th>other actions</th></tr>
+ <tr align="center">
+ <th>0</th> <td>unchanged</td> <td></td></tr>
+ <tr align="center">
+ <th>1</th> <td>from rect</td> <td></td></tr>
+ <tr align="center">
+ <th>2</th> <td>from input x,y</td> <td></td></tr>
+ <tr align="center">
+ <th>3</th> <td>from rect</td> <td>isometric axes</td></tr>
+ <tr align="center">
+ <th>4</th> <td>from input x,y</td> <td>isometric axes</td></tr>
+ <tr align="center">
+ <th>5</th> <td>from rect</td> <td>pretty axes</td></tr>
+ <tr align="center">
+ <th>6</th> <td>from input x,y</td> <td>pretty axes</td></tr>
+ <tr align="center">
+ <th>7</th> <td>from rect</td> <td>all replot with new scales</td></tr>
+ <tr align="center">
+ <th>8</th> <td>from input x,y</td> <td>all replot with new scales</td></tr>
+ <tr align="center">
+ <th>9</th> <td>from input x,y</td> <td>Pretty axes. All replot with new scales</td></tr>
+ </table>
+ </para>
+ <para>
+ The setting of axes boundaries can also be customized through
+ the <literal>gca().data_bounds</literal>,
+ <literal>gca().tight_limits</literal>,
+ <literal>gca().data_bounds</literal>, and
+ <literal>gca().isoview</literal> properties
+ (see <link linkend="axes_properties">axes_properties</link>).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>axesflag</term>
<listitem>
- <para>軸の描画方法を指定するためにこのオプションを指定することができます.
- 値には 0 から 5の範囲の整数を指定します :
+ <para>
+ integer code in [0:5 9], controlling the display and position of
+ X and Y axes.
</para>
- <variablelist>
- <varlistentry>
- <term>axesflag=0</term>
- <listitem>
- <para>プロットの周囲に何も描画されません (axes_visible=["off"
- "off"];box="off").
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag=1</term>
- <listitem>
- <para>軸が描画され, y軸が左に表示されます
- (axes_visible=["on" "on"];box="on",y_location="left").
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag=2</term>
- <listitem>
- <para>プロットは目盛のない箱で囲われます
- (axes_visible=["off" "off"];box="on").
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag=3</term>
- <listitem>
- <para>軸が描画され, y軸が右に表示されます
- (axes_visible=["on"
- "on"];box="off",y_location="right").
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag=4</term>
- <listitem>
- <para>軸がフレームの中心に描画され,箱は描画されません
- (axes_visible=["on" "on"];box="off",x_location="middle",
- y_location="middle").
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag=5</term>
- <listitem>
- <para>
- <literal>axesflag=4</literal>に似た軸がフレームの中心に描画されます.
- 違いは箱が描画されることです
- (axes_visible=["on" "on"];box="on",x_location="middle",y_location="middle").
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag=9</term>
- <listitem>
- <para>軸が描画され, y軸が左に表示されます
- (axes_visible=["on" "on"];box="off",y_location="left").
- これがデフォルト値です
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para>軸の特性も軸エンティティプロパティによりカスタマイズできます
- (<link linkend="axes_properties">axes_properties</link>参照).
+ <para>
+ The axes aspect can also be customized directly through the
+ <literal>gca().box</literal>, <literal>gca().axes_visible</literal>,
+ <literal>gca().x_location</literal>, and <literal>gca().y_location</literal>,
+ properties (see <link linkend="axes_properties">axes_properties</link>).
</para>
+ <table border="1" cellpadding="1">
+ <tr><th>axesFlag</th><th>.box</th><th>.axes_visible</th><th>axes position</th><th>comments</th></tr>
+ <tr align="center">
+ <th>0</th><td>"off"</td><td>["off" "off"]</td><td></td> <td>Naked plot</td></tr>
+ <tr align="center">
+ <th>1</th><td>"on"</td> <td>["on" "on"]</td> <td></td> <td></td></tr>
+ <tr align="center">
+ <th>2</th><td>"on"</td> <td>["off" "off"]</td><td></td> <td>Naked box</td></tr>
+ <tr align="center">
+ <th>3</th><td>"off"</td><td>["on" "on"]</td> <td>y_location="right"</td><td></td></tr>
+ <tr align="center">
+ <th>4</th><td>"off"</td><td>["on" "on"]</td> <td>crossed @ middle</td><td></td></tr>
+ <tr align="center">
+ <th>5</th><td>"on"</td> <td>["on" "on"]</td> <td>crossed @ middle</td><td></td></tr>
+ <tr align="center">
+ <th>9</th><td>"off"</td><td>["on" "on"]</td> <td></td> <td>(default setting)</td></tr>
+ </table>
</listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection role="description">
- <title>その他の情報</title>
- <para>デフォルトで, 連続プロットは重ね書きされます. 前のプロットを
- 消去するには,
- <literal>
- <link linkend="clf">clf()</link>
- </literal>
- を使用してください.
+ <title>説明</title>
+ <para>
+ <literal>plot2d</literal> は一連の2次元曲線をプロットします.
+ 指定した曲線の点の間は区分線形補間が行われます.
+ </para>
+ <para>
+ Any point with <literal>y(i)=Nan</literal> is masked: no mark and no segment to its
+ neighboors are displayed.
+ </para>
+ <para>
+ For any point with <literal>y(i)=±Inf</literal>, a vertical segment starting
+ from each of its both neighboors is drawn in the ± direction, up to the current ceil
+ or down to the current floor of the axes.
+ </para>
+ <para>
+ By default, successive calls to plot2d() overplots new curves over existing ones.
+ Autoclearing for each new plot can be set using <literal>gca().auto_clear="on"</literal>.
+ Please see <link linkend="axes_properties">axes properties</link>.
+ <literal><link linkend="clf">clf</link></literal> can also be used to manually clear
+ the whole figure.
+ </para>
+ <para>
+ Matlabの<literal>plot</literal>構文に慣れている場合には,
+ <link linkend="plot">plot</link>を使用するべきです.
+ </para>
+ <para>
+ <literal>x</literal> および <literal>y</literal> がベクトルの場合,
+ plot2d(x,y,<opt_args>) はベクトル <literal>y</literal> を
+ ベクトル <literal>x</literal>に対してプロットします.
+ ベクトル<literal>x</literal> および <literal>y</literal>は
+ 同じ数のエントリを有する必要があります.
+ </para>
+ <para>
+ <literal>x</literal> がベクトルで <literal>y</literal> が行列の場合,
+ plot2d(x,y,<opt_args>) は<literal>y</literal>の各列を
+ ベクトル<literal>x</literal>に対してプロットします.
+ この場合,<literal>y</literal>の列の数は<literal>x</literal>
+ のエントリの数に等しい必要があります.
</para>
<para>
+ <literal>x</literal> および <literal>y</literal> が行列の場合,
+ plot2d(x,y,<opt_args>) は<literal>y</literal>の各列を
+ 対応する<literal>x</literal>の列に対してプロットします.
+ この場合,<literal>x</literal> と<literal>y</literal>の
+ 大きさは同じである必要があります.
+ </para>
+ <para>
+ <literal>y</literal> がベクトルの場合, plot2d(y,<opt_args>)
+ はベクトル <literal>y</literal> をベクトル
+ <literal>1:size(y,'*')</literal>に対してプロットします.
+ </para>
+ <para>
+ <literal>y</literal> が行列の場合, plot2d(y,<opt_args>)
+ は<literal>y</literal>の各列をベクトル
+ <literal>1:size(y,1)</literal>に対してプロットします.
+ </para>
+ <para>
+ プロットをカスタマイズするために引数<literal><opt_args></literal> を
+ 使用することができます.
+ </para>
+
+ <para>
デモを参照するにはコマンド <literal>plot2d()</literal> を使用してください.
</para>
<para>その他に以下のような高レベルplot2d 関数が存在します:</para>
<link linkend="plot">plot</link>
</member>
<member>
+ <link linkend="polyline_properties">.polyline_style</link>
+ </member>
+ <member>
<link linkend="plot2d2">plot2d2</link>
</member>
<member>
<link linkend="plot2d4">plot2d4</link>
</member>
<member>
- <link linkend="clf">clf</link>
+ <link linkend="polarplot">polarplot</link>
</member>
<member>
- <link linkend="xdel">xdel</link>
+ <link linkend="gca">gca</link>
</member>
<member>
- <link linkend="delete">delete</link>
+ <link linkend="axes_properties">axes_properties</link>
+ </member>
+ <member>
+ <link linkend="clf">clf</link>
</member>
</simplelist>
</refsection>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA
- * Copyright (C) 2009 - DIGITEO - Pierre Lando
- * Copyright (C) 2010 - DIGITEO - Yann Collette
- *
- * 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:ns5="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="plot2d" xml:lang="en">
- <refnamediv>
- <refname>plot2d</refname>
- <refpurpose>2D plot</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Syntax</title>
- <synopsis>
- plot2d([logflag,][x,],y[,style[,strf[,leg[,rect[,nax]]]]])
- plot2d([logflag,][x,],y,<opt_args>)
- </synopsis>
- </refsynopsisdiv>
- <refsection role="parameters">
- <title>Arguments</title>
- <variablelist>
- <varlistentry>
- <term>x</term>
- <listitem>
- <para>a real matrix or vector. If omitted, it is assumed to be the
- vector <literal>1:n</literal> where <literal>n</literal> is the
- number of curve points given by the <literal>y</literal>
- parameter.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y</term>
- <listitem>
- <para>a real matrix or vector.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><opt_args></term>
- <listitem>
- <para>This represents a sequence of statements
- <literal>key1=value1,key2=value2</literal>,... where
- <literal>key1</literal>, <literal>key2,...</literal> can be one of
- the following:
- </para>
- <variablelist>
- <varlistentry>
- <term>logflag</term>
- <listitem>
- <para>sets the scale (linear or logarithmic) along the axes.
- The associated value should be a string with possible
- values: <literal>"nn"</literal>, <literal>"nl"</literal> ,
- <literal>"ln"</literal> and <literal>"ll"</literal> .
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>style</term>
- <listitem>
- <para>sets the style for each curve. The associated value
- should be a real vector with integer (positive or negative)
- values.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>strf</term>
- <listitem>
- <para>controls the display of captions.</para>
- <para>
- <literal>strf</literal> is a string of length 3
- <literal>"xyz"</literal> (by default <literal>strf=
- "081"
- </literal>
- )
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>leg</term>
- <listitem>
- <para>sets the curves captions. The associated value should be
- a character string.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>rect</term>
- <listitem>
- <para>sets the minimal bounds requested for the plot. The
- associated value should be a real vector with four entries:
- <literal>[xmin,ymin,xmax,ymax]</literal>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>nax</term>
- <listitem>
- <para>sets the axes labels and tics definition. The associated
- value should be a real vector with four integer entries
- <literal>[nx,Nx,ny,Ny].</literal>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag</term>
- <listitem>
- <para>controls the computation of the actual coordinate ranges
- from the minimal requested values. The associated value should
- be an integer ranging from 0 to 8.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag</term>
- <listitem>
- <para>specifies how the axes are drawn. The associated value
- should be an integer ranging from 0 to 5 or 9 (default value).
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection role="description">
- <title>Description</title>
- <para>
- <literal>plot2d</literal> plots a set of 2D curves. If you are
- familiar with Matlab <literal>plot</literal> syntax, you should use <link linkend="plot">plot</link>.
- </para>
- <para>
- If <literal>x</literal> and <literal>y</literal> are vectors,
- plot2d(x,y,<opt_args>) plots vector <literal>y</literal> versus
- vector <literal>x</literal>. <literal>x</literal> and <literal>y</literal>
- vectors should have the same number of entries.
- </para>
- <para>
- If <literal>x</literal> is a vector and <literal>y</literal> a
- matrix plot2d(x,y,<opt_args>) plots each columns of
- <literal>y</literal> versus vector <literal>x</literal>. The
- number of rows of <literal>y</literal> must be equal to the number of
- <literal>x</literal> entries.
- </para>
- <para>
- If <literal>x</literal> and <literal>y</literal> are matrices,
- plot2d(x,y,<opt_args>) plots each columns of <literal>y</literal>
- versus corresponding column of <literal>x</literal>.
- <literal>x</literal> and <literal>y</literal> must then have the same sizes.
- </para>
- <para>
- If <literal>y</literal> is a vector, plot2d(y,<opt_args>)
- plots vector <literal>y</literal> versus vector
- <literal>1:size(y,'*')</literal>.
- </para>
- <para>
- If <literal>y</literal> is a matrix, plot2d(y,<opt_args>)
- plots each columns of <literal>y</literal> versus vector
- <literal>1:size(y,1)</literal>.
- </para>
- <para>
- The <literal><opt_args></literal> arguments should be used to
- customize the plot
- </para>
- <variablelist>
- <varlistentry>
- <term>logflag</term>
- <listitem>
- <para>This option may be used to set the scale (linear or
- logarithmic) along the axes. The associated value should be a
- string with possible values: <literal>"nn"</literal>,
- <literal>"nl"</literal> , <literal>"ln"</literal> and
- <literal>"ll"</literal>. <literal>"l"</literal> stands for
- logarithmic scale and graduations and <literal>"n"</literal> for
- normal scale.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>style</term>
- <listitem>
- <para>This option may be used to specify how the curves are drawn.
- If this option is specified, the associated value should be a vector
- with as many entries as curves.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- if <literal>style(i)</literal> is strictly positive, the
- curve is drawn as plain line and <literal>style(i)</literal>
- defines the index of the color used to draw the curve (see <link linkend="getcolor">getcolor</link>). Note that the line style
- and the thickness can be set through the polyline entity
- properties (see <link linkend="polyline_properties">polyline_properties</link>).
- </para>
- <para>Piecewise linear interpolation is done between the given
- curve points.
- </para>
- </listitem>
- <listitem>
- <para>
- if <literal>style(i)</literal> is negative or zero, the
- given curve points are drawn using marks,
- <literal>abs(style(i))</literal> defines the mark with id used.
- Note that the marks color and marks sizes can be set through
- the polyline entity properties (see <link linkend="polyline_properties">polyline_properties</link>).
- </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>strf</term>
- <listitem>
- <para>
- is a string of length 3 <literal>"xyz"</literal> (by default
- <literal>strf= "081"</literal>)
- </para>
- <variablelist>
- <varlistentry>
- <term>x</term>
- <listitem>
- <para>controls the display of captions.</para>
- <variablelist>
- <varlistentry>
- <term>x=0</term>
- <listitem>
- <para>no caption.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>x=1</term>
- <listitem>
- <para>captions are displayed. They are given by the
- optional argument <literal>leg</literal>.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y</term>
- <listitem>
- <para>controls the computation of the actual coordinate ranges
- from the minimal requested values. Actual ranges can be larger
- than minimal requirements.
- </para>
- <variablelist>
- <varlistentry>
- <term>y=0</term>
- <listitem>
- <para>no computation, the plot use the previous (or
- default) scale
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=1</term>
- <listitem>
- <para>from the rect arg</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=2</term>
- <listitem>
- <para>from the min/max of the x, y data</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=3</term>
- <listitem>
- <para>built for an isometric scale from the rect
- arg
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=4</term>
- <listitem>
- <para>built for an isometric plot from the min/max of
- the x, y data
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=5</term>
- <listitem>
- <para>enlarged for pretty axes from the rect arg</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=6</term>
- <listitem>
- <para>enlarged for pretty axes from the min/max of the
- x, y data
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=7</term>
- <listitem>
- <para>like y=1 but the previous plot(s) are redrawn to
- use the new scale
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>y=8</term>
- <listitem>
- <para>like y=2 but the previous plot(s) are redrawn to
- use the new scale
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>z</term>
- <listitem>
- <para>controls the display of information on the frame around
- the plot. If axes are requested, the number of tics can be
- specified by the <literal>nax</literal> optional
- argument.
- </para>
- <variablelist>
- <varlistentry>
- <term>z=0</term>
- <listitem>
- <para>nothing is drawn around the plot.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>z=1</term>
- <listitem>
- <para>axes are drawn, the y=axis is displayed on the
- left.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>z=2</term>
- <listitem>
- <para>the plot is surrounded by a box without
- tics.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>z=3</term>
- <listitem>
- <para>axes are drawn, the y=axis is displayed on the
- right.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>z=4</term>
- <listitem>
- <para>axes are drawn centred in the middle of the frame
- box.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>z=5</term>
- <listitem>
- <para>axes are drawn so as to cross at point
- <literal>(0,0)</literal>. If point
- <literal>(0,0)</literal> does not lie inside the frame,
- axes will not appear on the graph.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </listitem>
- </varlistentry>
- </variablelist>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>leg</term>
- <listitem>
- <para>This option may be used to sets the curve captions. It must be
- a string with the form <literal>"leg1@leg2@...."</literal> where
- <literal>leg1</literal> , <literal>leg2</literal> , etc. are
- respectively the captions of the first curve, of the second curve,
- etc. The default is <literal> " "</literal>.
- </para>
- <para>The curve captions are drawn on below the x-axis. This option
- is not flexible enough, use the <link linkend="captions">captions</link> or <link linkend="legend">legend</link> functions preferably.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>rect</term>
- <listitem>
- <para>This option may be used to set the minimal bounds requested
- for the plot. If this option is specified, the associated value
- should be a real vector with four entries:
- </para>
- <para>
- <literal>[xmin,ymin,xmax,ymax]</literal>.
- <literal>xmin</literal> and <literal>xmax</literal> defines the
- bounds on the abscissae while <literal>ymin</literal> and
- <literal>ymax</literal> defines the bounds on the ordinates.
- </para>
- <para>This argument may be used together with the
- <literal>frameflag</literal> option to specify how the axes
- boundaries are derived from the given <literal>rect</literal>
- argument. If the <literal>frameflag</literal> option is not given,
- it is supposed to be <literal>frameflag=7</literal>.
- </para>
- <para>The axes boundaries can also be customized through the axes
- entity properties (see <link linkend="axes_properties">axes_properties</link>).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>nax</term>
- <listitem>
- <para>This option may be used to specify the axes labels and tics
- definition. The associated value should be a real vector with four integer entries
- <literal>[nx,Nx,ny,Ny]</literal>.
- </para>
- <para>
- <literal>Nx</literal> gives the number of main tics to be used
- on the x-axis (to use autoticks set it to -1), <literal>nx</literal> gives the number of
- subtics to be drawn between two main x-axis tics.
- </para>
- <para>
- <literal>Ny</literal> and <literal>ny</literal> give similar
- information for the y-axis.
- </para>
- <para>
- If <literal>axesflag</literal> option is not set
- <literal>nax</literal> option supposes that
- <literal>axesflag</literal> option has been set to 9.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag</term>
- <listitem>
- <para>This option may be used to control the computation of the
- actual coordinate ranges from the minimal requested values. Actual
- ranges can be larger than minimal requirements.
- </para>
- <variablelist>
- <varlistentry>
- <term>frameflag=0</term>
- <listitem>
- <para>no computation, the plot use the previous (or default)
- scale.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=1</term>
- <listitem>
- <para>The actual range is the range given by the
- <literal>rect</literal> option.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=2</term>
- <listitem>
- <para>The actual range is computed from the min/max of the
- <literal>x</literal> and <literal>y</literal> data.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=3</term>
- <listitem>
- <para>The actual range is the range given by the
- <literal>rect</literal> option and enlarged to get an
- isometric scale.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=4</term>
- <listitem>
- <para>The actual range is computed from the min/max of the
- <literal>x</literal> and <literal>y</literal> data and
- enlarged to get an isometric scale.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=5</term>
- <listitem>
- <para>The actual range is the range given by the
- <literal>rect</literal> option and enlarged to get pretty axes
- labels.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=6</term>
- <listitem>
- <para>The actual range is computed from the min/max of the
- <literal>x</literal> and <literal>y</literal> data and
- enlarged to get pretty axes labels.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=7</term>
- <listitem>
- <para>
- like <literal>frameflag=1</literal> but the previous
- plot(s) are redrawn to use the new scale. Used to add the
- current graph to a previous one.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=8</term>
- <listitem>
- <para>
- like<literal>frameflag=2</literal> but the previous
- plot(s) are redrawn to use the new scale. Used to add the
- current graph to a previous one.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>frameflag=9</term>
- <listitem>
- <para>
- like<literal>frameflag=8</literal> but the range is
- enlarged to get pretty axes labels. This is the default
- value.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para>The axes boundaries can also be customized through the axes
- entity properties (see <link linkend="axes_properties">axes_properties</link>)
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag</term>
- <listitem>
- <para>This option may be used to specify how the axes are drawn. The
- associated value should be an integer ranging from 0 to 5 :
- </para>
- <variablelist>
- <varlistentry>
- <term>axesflag=0</term>
- <listitem>
- <para>nothing is drawn around the plot (axes_visible=["off"
- "off"];box="off").
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag=1</term>
- <listitem>
- <para>axes are drawn, the y-axis is displayed on the left
- (axes_visible=["on" "on"];box="on",y_location="left").
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag=2</term>
- <listitem>
- <para>the plot is surrounded by a box without tics
- (axes_visible=["off" "off"];box="on").
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag=3</term>
- <listitem>
- <para>axes are drawn, the y-axis is displayed on the
- right (axes_visible=["on"
- "on"];box="off",y_location="right").
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag=4</term>
- <listitem>
- <para>axes are drawn centered in the middle of the frame, the box
- being not drawn (axes_visible=["on" "on"];box="off",x_location="middle",
- y_location="middle").
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag=5</term>
- <listitem>
- <para>axes are drawn centered in the middle of the frame similarly to
- <literal>axesflag=4</literal>, the difference being that the box is drawn
- (axes_visible=["on" "on"];box="on",x_location="middle",y_location="middle").
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>axesflag=9</term>
- <listitem>
- <para>axes are drawn, the y-axis is displayed on the left
- (axes_visible=["on" "on"];box="off",y_location="left"). This
- is the default value.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para>The axes aspect can also be customized through the axes
- entity properties (see <link linkend="axes_properties">axes_properties</link>).
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection role="description">
- <title>More information</title>
- <para>By default, successive plots are superposed. To clear the previous plot, use
- <literal>
- <link linkend="clf">clf()</link>
- </literal>
- .
- </para>
- <para>
- Enter the command <literal>plot2d()</literal> to see a demo.
- </para>
- <para>Other high level plot2d functions exist:</para>
- <itemizedlist>
- <listitem>
- <para>
- plot2d2 same as <literal>plot2d</literal> but the curve is
- supposed to be piecewise constant.
- </para>
- </listitem>
- <listitem>
- <para>
- plot2d3 same as <literal>plot2d</literal> but the curve is
- plotted with vertical bars.
- </para>
- </listitem>
- <listitem>
- <para>
- plot2d4 same as <literal>plot2d</literal> but the curve is
- plotted with vertical arrows.
- </para>
- </listitem>
- </itemizedlist>
- </refsection>
- <refsection role="examples">
- <title>Examples</title>
- <programlisting role="example"><![CDATA[
-// x initialisation
-x=[0:0.1:2*%pi]';
-//simple plot
-plot2d(sin(x));
- ]]></programlisting>
- <scilab:image>
- x=[0:0.1:2*%pi]';
- plot2d(sin(x));
- </scilab:image>
- <programlisting role="example"><![CDATA[
-clf();
-x=[0:0.1:2*%pi]';
-plot2d(x,sin(x));
-//multiple plot
- ]]></programlisting>
- <scilab:image>
- x=[0:0.1:2*%pi]';
- plot2d(x,sin(x));
- </scilab:image>
- <programlisting role="example"><![CDATA[
-clf();
-x=[0:0.1:2*%pi]';
-plot2d(x,[sin(x) sin(2*x) sin(3*x)])
- ]]></programlisting>
- <scilab:image>
- x=[0:0.1:2*%pi]';
- plot2d(x,[sin(x) sin(2*x) sin(3*x)])
- </scilab:image>
- <programlisting role="example"><![CDATA[
-// multiple plot giving the dimensions of the frame
-clf();
-x=[0:0.1:2*%pi]';
-plot2d(x,[sin(x) sin(2*x) sin(3*x)],rect=[0,0,6,0.5]);
- ]]></programlisting>
- <scilab:image>
- x=[0:0.1:2*%pi]';
- plot2d(x,[sin(x) sin(2*x) sin(3*x)],rect=[0,0,6,0.5]);
- </scilab:image>
- <programlisting role="example"><![CDATA[
-//multiple plot with captions and given tics + style
-clf();
-x=[0:0.1:2*%pi]';
-plot2d(x,[sin(x) sin(2*x) sin(3*x)],..
- [1,2,3],leg="L1@L2@L3",nax=[2,10,2,10],rect=[0,-2,2*%pi,2]);
- ]]></programlisting>
- <scilab:image>
- x=[0:0.1:2*%pi]';
- plot2d(x,[sin(x) sin(2*x) sin(3*x)],..
- [1,2,3],leg="L1@L2@L3",nax=[2,10,2,10],rect=[0,-2,2*%pi,2]);
- </scilab:image>
- <programlisting role="example"><![CDATA[
-// isoview
-clf();
-x=[0:0.1:2*%pi]';
-plot2d(x,sin(x),1,frameflag= 4);
- ]]></programlisting>
- <scilab:image>
- x=[0:0.1:2*%pi]';
- plot2d(x,sin(x),1,frameflag= 4);
- </scilab:image>
- <programlisting role="example"><![CDATA[
-// scale
-clf();
-x=[0:0.1:2*%pi]';
-plot2d(x,sin(x),1,frameflag= 6);
- ]]></programlisting>
- <scilab:image>
- x=[0:0.1:2*%pi]';
- plot2d(x,sin(x),1,frameflag= 6);
- </scilab:image>
- <programlisting role="example"><![CDATA[
-// auto scaling with previous plots + style
-clf();
-x=[0:0.1:2*%pi]';
-plot2d(x,sin(x),-1);
-plot2d(x,2*sin(x),12);
-plot2d(2*x,cos(x),3);
- ]]></programlisting>
- <scilab:image>
- x=[0:0.1:2*%pi]';
- plot2d(x,sin(x),-1);
- plot2d(x,2*sin(x),12);
- plot2d(2*x,cos(x),3);
- </scilab:image>
- <programlisting role="example"><![CDATA[
-// axis on the right
-clf();
-x=[0:0.1:2*%pi]';
-plot2d(x,sin(x),leg="sin(x)");
-a=gca(); // Handle on axes entity
-a.y_location ="right";
- ]]></programlisting>
- <scilab:image>
- x=[0:0.1:2*%pi]';
- plot2d(x,sin(x),leg="sin(x)");
- a=gca(); // Handle on axes entity
- a.y_location ="right";
- </scilab:image>
- <programlisting role="example"><![CDATA[
-
-// axis centered at (0,0)
-clf();
-x=[0:0.1:2*%pi]';
-plot2d(x-4,sin(x),1,leg="sin(x)");
-a=gca(); // Handle on axes entity
-a.x_location = "origin";
-a.y_location = "origin";
-// Some operations on entities created by plot2d ...
-isoview
-a=gca();
-a.children // list the children of the axes.
-// There are a compound made of two polylines and a legend
-poly1= a.children(1).children(1); //store polyline handle into poly1
-poly1.foreground = 4; // another way to change the style...
-poly1.thickness = 3; // ...and the thickness of a curve.
-poly1.clip_state='off'; // clipping control
-leg = a.children(2); // store legend handle into leg
-leg.font_style = 9;
-leg.line_mode = "on";
-isoview off
- ]]></programlisting>
- <scilab:image>
- // axis centered at (0,0)
- clf();
- x=[0:0.1:2*%pi]';
- plot2d(x-4,sin(x),1,leg="sin(x)");
- a=gca(); // Handle on axes entity
- a.x_location = "origin";
- a.y_location = "origin";
- // Some operations on entities created by plot2d ...
- isoview()
- a=gca();
- a.children // list the children of the axes.
- // There are a compound made of two polylines and a legend
- poly1= a.children(1).children(1); //store polyline handle into poly1
- poly1.foreground = 4; // another way to change the style...
- poly1.thickness = 3; // ...and the thickness of a curve.
- poly1.clip_state='off'; // clipping control
- leg = a.children(2); // store legend handle into leg
- leg.font_style = 9;
- leg.line_mode = "on";
- isoview("off")
- </scilab:image>
- </refsection>
- <refsection role="see also">
- <title>See also</title>
- <simplelist type="inline">
- <member>
- <link linkend="plot">plot</link>
- </member>
- <member>
- <link linkend="plot2d2">plot2d2</link>
- </member>
- <member>
- <link linkend="plot2d3">plot2d3</link>
- </member>
- <member>
- <link linkend="plot2d4">plot2d4</link>
- </member>
- <member>
- <link linkend="clf">clf</link>
- </member>
- <member>
- <link linkend="xdel">xdel</link>
- </member>
- <member>
- <link linkend="delete">delete</link>
- </member>
- </simplelist>
- </refsection>
-</refentry>
}
// Check strf [0-1][0-8][0-5]
- if (!isDefStrf(strf) && (strlen(strf) != 3 || strf[0] < '0' || strf[0] > '1' || strf[1] < '0' || strf[1] > '8' || strf[2] < '0' || strf[2] > '5'))
+ if (!isDefStrf(strf) && (strlen(strf) != 3 || strf[0] < '0' || strf[0] > '1' || strf[1] < '0' || strf[1] > '9' || strf[2] < '0' || strf[2] > '5'))
{
Scierror(999, _("%s: Wrong value for strf option: %s.\n"), fname, strf);
if (freeStrf)
}
if (frame != &frame_def)
{
- if (*frame >= 0 && *frame <= 8)
+ if (*frame >= 0 && *frame <= 9)
{
strfl[1] = (char)(*frame + 48);
}
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- NO CHECK REF -->
+//
+// <-- Non-regression test for bug 14488 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/14488
+//
+// <-- Short Description -->
+// plot2d(..,frameflag=9) was no longer accepted
+// =============================================================================
+
+
+assert_checkequal(execstr("plot2d(1:10,frameflag=9)","errcatch"), 0);
+assert_checkequal(execstr("plot2d(1:10,strf=""091"")","errcatch"), 0);