* Bug 15948 fixed: xyzlabel() & title() upgraded 78/20878/11
Samuel GOUGEON [Fri, 22 Feb 2019 15:05:28 +0000 (16:05 +0100)]
 * http://bugzilla.scilab.org/15948

 * new xyzlabel() page: http://bugzilla.scilab.org/attachment.cgi?id=4902

 REQUIRES https://codereview.scilab.org/21197 (iscolor() extension)

Change-Id: I79ec38dbc31f8fadda3df439661aecc7a1d812bf

14 files changed:
scilab/CHANGES.md
scilab/modules/graphics/help/en_US/annotation/title.xml
scilab/modules/graphics/help/en_US/annotation/xlabel.xml
scilab/modules/graphics/help/ja_JP/annotation/title.xml [deleted file]
scilab/modules/graphics/help/ja_JP/annotation/xlabel.xml [deleted file]
scilab/modules/graphics/help/pt_BR/annotation/title.xml [deleted file]
scilab/modules/graphics/macros/TitleLabel.sci
scilab/modules/graphics/macros/getTitleLabelPropertyNam.sci [deleted file]
scilab/modules/graphics/macros/setTitleLabelProperty.sci [deleted file]
scilab/modules/graphics/tests/unit_tests/xyzlabel_title.tst [new file with mode: 0644]
scilab/modules/helptools/data/configuration/scilab_macros.txt
scilab/modules/helptools/etc/images_md5.txt
scilab/modules/helptools/images/title_1.png
scilab/modules/helptools/images/xlabel_1.png

index f19a88f..450a671 100644 (file)
@@ -242,6 +242,7 @@ Bug Fixes
 * [#15745](http://bugzilla.scilab.org/show_bug.cgi?id=15745): `diophant(0,0,m)`, `diophant([p 0],q)`, `diophant([0 p],q)` with m<>0 and p>q were wrong. There was no flag for cases with an infinite number of solutions. When there is no solution, some values were returned anyway, instead of []. In this case, the documented definition of the err value was dubious. Decimal numbers and integers were accepted, but not encoded integers. Inf and NaN input coefficients were not rejected.
 * [#15812](http://bugzilla.scilab.org/show_bug.cgi?id=15812): On assigning variables the source variable may become become corrupted
 * [#15840](http://bugzilla.scilab.org/show_bug.cgi?id=15840): `grand(1,"prm",m)` yielded an unsqueezed size([size(m) 1]) hypermatrix
+* [#15948](http://bugzilla.scilab.org/show_bug.cgi?id=15948): `xlabel`, `ylabel`, `zlabel` and `title` needed to be upgraded.
 * [#15964](http://bugzilla.scilab.org/show_bug.cgi?id=15954): A complex empty sparse matrix could be obtained after insertion.
 * [#15969](http://bugzilla.scilab.org/show_bug.cgi?id=15969): Fix spelling
 * [#15974](http://bugzilla.scilab.org/show_bug.cgi?id=15974): `msprintf("%d", %nan)` did not return Nan
index 63a6acc..7f12b44 100644 (file)
@@ -2,8 +2,8 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) INRIA - Farid Belahcene
- * Copyright (C) 2013 - Samuel GOUGEON
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2016, 2019 - 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.
  * 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="title">
+<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="title">
     <refnamediv>
         <refname>title</refname>
-        <refpurpose>display a title on a graphic
-            window
+        <refpurpose>displays a title above a graphic axes, or updates its properties.
         </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>title(my_title)
-            title(my_title,&lt;Property&gt;)
-            title(&lt;axes_handle&gt;,&lt;my_title&gt;,&lt;Property&gt;)
+        <synopsis>
+            title(text)
+            title(text, property_name, property_value,...)
+            title(property_name, property_value,...)
+            title(axes_handle,...)
         </synopsis>
     </refsynopsisdiv>
-    <refsection>
+    <refsection role="parameters">
         <title>Arguments</title>
         <variablelist>
             <varlistentry>
-                <term>my_title</term>
+                <term>text</term>
                 <listitem>
-                    <para>a string, it's the title to display</para>
+                    <para>
+                        Matrix of text of the title. A title can have multiple rows or/and
+                        columns of text. Leading and trailing blanks are trimmed.
+                        In their columns, texts are left-justified.
+                        <link linkend="math_rendering_features_in_graphic">LaTeX expressions</link>
+                        delimited with "$...$" are supported.
+                    </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>&lt;Property&gt;</term>
+                <term>axes_handle</term>
                 <listitem>
-                    <para>This optional argument represents a sequence of couple
-                        statements <literal>{PropertyName,PropertyValue}</literal> that defines
-                        global objects' properties applied to the created title.
+                    <para>
+                        Handle of the axes whose title must be set or updated.
+                        By default, the current axes is processed. Otherwise, the given axes
+                        is set as and remains the current one after returning from
+                        <literal>title()</literal>.
                     </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>&lt;axes_handle&gt;</term>
+                <term>property_name, property_value,...</term>
                 <listitem>
-                    <para>This optional argument forces the title to appear inside the
-                        selected axes given by <literal>axes_handle</literal> rather than the
-                        current axes (see <link linkend="gca">gca</link>).
+                    <para>
+                        unlimited series of pairs of property name (word) and the respective value
+                        to assign to it. The available properties are related to
+                        <link linkend="label_properties">labels properties</link>). Some of them
+                        have an alias that can be used as well with <literal>title()</literal>:
+                    </para>
+                    <para>
+                        <table border="1">
+                            <tr>
+                                <th align="left">visible</th>
+                                <th></th>
+                                <td>
+                                    <literal>"on"</literal> or <literal>"off"</literal>.
+                                    If <literal>"off"</literal>, the title (and its box) still
+                                    exists but is not displayed.
+                        </td>
+                            </tr>
+                            <tr>
+                                <th align="left">fontsize</th>
+                                <th align="left">font_size</th>
+                                <td>
+                                    Scalar positive number specifying the size of displayed
+                                    characters. default = 1. For any non-integer size, the font is
+                                    scaled accordingly and anti-aliased (made a bit foggy).
+                                </td>
+                            </tr>
+                            <tr>
+                                <th align="left">fontname</th>
+                                <th align="left">font_style</th>
+                                <td>
+                                    Ten font names are available (case and space unsensitive string),
+                                    or their related id number:
+                                    <table>
+                                        <tr>
+                                            <td>0</td><td>"courrier"</td><td></td>
+                                            <td>2</td><td>"times"</td><td></td>
+                                            <td>6</td><td>"helvetica"</td>
+                                        </tr>
+                                        <tr>
+                                            <td>1</td><td>"symbol"</td><td></td>
+                                            <td>3</td><td>"times italic"</td><td></td>
+                                            <td>7</td><td>"helvetica italic"</td>
+                                        </tr>
+                                        <tr>
+                                            <td></td><td></td><td></td>
+                                            <td>4</td><td>"times bold"</td><td></td>
+                                            <td>8</td><td>"helvetica bold"</td>
+                                        </tr>
+                                        <tr>
+                                            <td></td><td></td><td></td>
+                                            <td>5</td><td>"times bold italic"</td><td></td>
+                                            <td>9</td><td>"helvetica bold italic"</td>
+                                        </tr>
+                                    </table>
+                                    <para>
+                                        For instance, 3, "3", "times italic", "timesitalic" or
+                                        "TimesItalic" are equivalent.
+                                    </para>
+                                    <para>
+                                        Other fonts can be loaded with <literal>xlfont()</literal>
+                                        and used.
+                                    </para>
+                                </td>
+                            </tr>
+                            <tr>
+                                <th align="left">color</th>
+                                <th align="left">font_foreground</th>
+                                <td>
+                                    Color of the text of the title (*).
+                                </td>
+                            </tr>
+                            <tr>
+                                <th align="left">position</th>
+                                <th></th>
+                                <td>
+                                    Vector of coordinates of the title's anchor, in data unit.
+                                    The anchor is the lower-left corner of the box of
+                                    the title (when horizontal). Note: This property can't be set
+                                    with a console-oriented syntax.
+                                </td>
+                            </tr>
+                            <tr>
+                                <th align="left">rotation</th>
+                                <th align="left">font_angle</th>
+                                <td>
+                                    Direct (anti-clockwise) angle of the title's block, in degrees,
+                                    horizontal = 0°.
+                                    The lower-left corner of the box bounding the horizontal title
+                                    is used as pivot (fixed point).
+                                </td>
+                            </tr>
+                            <tr>
+                                <th align="left">box</th>
+                                <th></th>
+                                <td>
+                                    "off" | "on": hides or displays a box around the block of text
+                                    of the title.
+                                </td>
+                            </tr>
+                            <tr>
+                                <th align="left">edgecolor</th>
+                                <th align="left">foreground</th>
+                                <td>
+                                    Color of the border of the box (if any)(*).The box is then
+                                    automatically turned "on".
+                                </td>
+                            </tr>
+                            <tr>
+                                <th align="left">background</th>
+                                <th align="left">backgroundcolor</th>
+                                <td>
+                                    Filling color of the box background, behing the text (*).
+                                    The box is then automatically turned "on".
+                                </td>
+                            </tr>
+                            <tr>
+                                <th align="left">tag</th>
+                                <th></th>
+                                <td>
+                                    String or matrix of strings: Custom literal identifier of the title.
+                                </td>
+                            </tr>
+                        </table>
+                    </para>
+                    <para>
+                        (*) Any color can be specified by any of the following:
+                        <itemizedlist>
+                            <listitem>
+                                Its numerical or literal index in the current colormap
+                                (like 13 or "13"). Special values whatever is the colormap:
+                                -1 for black, -2 for white.
+                            </listitem>
+                            <listitem>
+                                Its name as a string, if it is a predefined
+                                <link linkend="color_list">listed color</link>. For colors among
+                                the short list
+                                ["red","green","blue","cyan","magenta","yellow","black","white"],
+                                shortened names are supported, like "m" for magenta or "k"
+                                for "black".
+                            </listitem>
+                            <listitem>
+                                Its "#RRGGBB" hexadecimal code, as a string.
+                            </listitem>
+                            <listitem>
+                                the [r,g,b] row of its Red/Green/Blue 0 ≤ r,g,b ≤ 1 intensities.
+                                This syntax can't be used in console-oriented mode.
+                            </listitem>
+                        </itemizedlist>
                     </para>
                 </listitem>
             </varlistentry>
     <refsection>
         <title>Description</title>
         <para>
-            <literal>title</literal> displays a title on a graphic window.
+            title() is used to set and display a title at the top of the current or given axes,
+            or to change properties of the existing title.
         </para>
         <para>
-            The <literal>Property</literal> arguments should be used to customize the
-            title. Here is a complete list of the available options.
+            <literal>title()</literal> can be called with a functional syntax like
+            <literal>title("My title", "fontsize", 3)</literal> or with an equivalent
+            console-oriented syntax like <literal>title "My title" fontsize 3</literal>.
+            However, [r,g,b] row color and [x,y] coordinates specifications can't be used
+            in console-oriented syntaxes.
         </para>
-        <variablelist>
-            <varlistentry>
-                <term>Property :</term>
-                <listitem>
-                    <para>
-                        <literal>backgroundcolor :</literal> this field contains the color used to
-                        fill the box if any. Its value should be a color index (relative to
-                        the current colormap).
-                    </para>
-                    <para>
-                        <literal>color :</literal> this field contains the color used to display
-                        the title text. Its value should be a color index (relative to the
-                        current colormap).
-                    </para>
-                    <para>
-                        <literal>edgecolor :</literal> this field contains the color used to
-                        display the line around the box if any. Its value should be a color
-                        index (relative to the current colormap).
-                    </para>
-                    <para>
-                        <literal>fontname :</literal> ten differents font names are available
-                        (case unsensitive string or related id number):
-                        "courrier" | 0, "symbol" | 1, "times" | 2, "times italic" | 3,
-                        "times bold" | 4, "times bold italic" | 5, "helvetica" | 6,
-                        "helvetica italic" | 7, "helvetica bold" | 8, "helvetica bold italic" | 9.
-                    </para>
-                    <para>
-                        <literal>fontsize :</literal> the fontsize property is used to specify
-                        the size of the font. It must be an integer >= 0.
-                    </para>
-                    <para>
-                        <literal>position :</literal> this 2d vector allows you to place manually
-                        the title on the screen. The position is stored in the data units of
-                        the axes.
-                    </para>
-                    <para>
-                        <literal>rotation :</literal> this scalar allows you to turn the title.
-                        The font is turned inverse clockise with the angle given in degrees.
-                    </para>
-                    <para>
-                        <literal>visible :</literal> this field contains the visible property
-                        value for the title. It should be "on" or "off". By default, the label
-                        is visible, the value's property is "on" . If "off" the title is not
-                        displayed on the screen.
-                    </para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
+        <warning>
+            When an axes handle is specified as the target axes, it becomes the current axes
+            and remains as is after leaving title().
+        </warning>
     </refsection>
     <refsection>
         <title>Examples</title>
         <programlisting role="example"><![CDATA[
-// display a title with several properties
-title('my title');
+plotframe([0 0 1 1])
+// display a title with its default properties
+title 'my title'
+
 // change the color for the font
-title('my title','color','blue');
-// change the color for the around the box
-title('my title','edgecolor','red');
+title color blue
+
+// change the color for the edge of the surrounding box, and displays the box
+title edgecolor red
+
 // change the position of the title
-title('my title','position',[0.3 0.8]);
+title('position', [0.3 0.8]);
+
 // change the size of the font
-title('my title','fontsize',3);
+title fontsize 3
+
 // a rotation
-title('my title','rotation',90);
+title rotation 90
 
 // We can do all these modifications with just the below instruction:
 title('my title','color','blue','edgecolor','red','fontsize',3,'rotation',90,'position',[0.3 0.8]);
  ]]></programlisting>
         <scilab:image>
-            title('my title','color','blue','edgecolor','red','fontsize',3,'rotation',90,'position',[0.3 0.8]);
-
+            plotframe([0 0 1 1])
+            title 'my title'  color blue  edgecolor red  fontsize 3  rotation 90
+            title('position', [0.3 0.8])
         </scilab:image>
-
     </refsection>
     <refsection role="see also">
         <title>See also</title>
@@ -151,6 +274,65 @@ title('my title','color','blue','edgecolor','red','fontsize',3,'rotation',90,'po
             <member>
                 <link linkend="xtitle">xtitle</link>
             </member>
+            <member>
+                <link linkend="xlabel">x|y|zlabel</link>
+            </member>
+            <member>
+                <link linkend="ieditor">Interactive editor</link>
+            </member>
+            <member>
+                <link linkend="xstring">xstring</link>
+            </member>
+            <member>
+                <link linkend="color_list">color_list</link>
+            </member>
+            <member>
+                <link linkend="color">color</link>
+            </member>
+            <member>
+                <link linkend="xlfont">xlfont</link>
+            </member>
+            <member>
+                <link linkend="set">set</link>
+            </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revdescription>
+                    <itemizedlist>
+                        <listitem>
+                            The <literal>text</literal> becomes optional, to update only properties.
+                        </listitem>
+                        <listitem>
+                            The full list of Scilab predefined colors names can now be used,
+                            as well as hexadecimal #RRGGBB colors codes.
+                        </listitem>
+                        <listitem>
+                            Console-oriented usages are now possible, specifying any color index,
+                            font id, font size, or box angle as a string like "13" instead of 13,
+                            excepted for [r,g,b] and [x,y,z] position.
+                        </listitem>
+                        <listitem>
+                            When a non-integer font size is specified,
+                            <literal>.fractional_font</literal> is now automatically turned "on".
+                            It is conversely forced to "off" for any input integer font size.
+                        </listitem>
+                        <listitem>
+                            Any specified font name is now space-insensitive.
+                        </listitem>
+                        <listitem>
+                            New property <literal>box="on"|"off"</literal> added.
+                        </listitem>
+                        <listitem>
+                            New property <literal>tag</literal> added.
+                        </listitem>
+                    </itemizedlist>
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index 9a6979f..dba3291 100644 (file)
@@ -2,8 +2,8 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) DIGITEO - 2011 - Allan CORNET
- * Copyright (C) 2016 - Samuel GOUGEON
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2016, 2019 - 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.
  * 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:ns3="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="xlabel" xml:lang="en">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="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="xlabel" xml:lang="en">
     <refnamediv>
         <refname>xlabel</refname>
-        <refpurpose>sets the x-axis label</refpurpose>
+        <refpurpose>sets or updates the x-axis label or/and its properties</refpurpose>
     </refnamediv>
     <refnamediv xml:id="ylabel">
         <refname>ylabel</refname>
-        <refpurpose>sets the y-axis label</refpurpose>
+        <refpurpose>sets or updates the y-axis label or/and its properties</refpurpose>
     </refnamediv>
     <refnamediv xml:id="zlabel">
         <refname>zlabel</refname>
-        <refpurpose>sets the z-axis label</refpurpose>
+        <refpurpose>sets or updates the z-axis label or/and its properties</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
         <synopsis>
-            xlabel([axes_handle], label, [property_name, property_value,...])
-            ylabel([axes_handle], label, [property_name, property_value,...])
-            zlabel([axes_handle], label, [property_name, property_value,...])
+            xlabel(label)
+            xlabel(label, property_name, property_value,...)
+            xlabel(property_name, property_value,...)
+            xlabel(axes_handle,...)
+
+            ylabel(label)
+            ylabel(label, property_name, property_value,...)
+            ylabel(property_name, property_value,...)
+            ylabel(axes_handle,...)
+
+            zlabel(label)
+            zlabel(label, property_name, property_value,...)
+            zlabel(property_name, property_value,...)
+            zlabel(axes_handle,...)
         </synopsis>
     </refsynopsisdiv>
     <refsection role="parameters">
             <varlistentry>
                 <term>label</term>
                 <listitem>
-                    <para>a string, containing the label value.</para>
+                    <para>
+                        Matrix of texts of the label. A label can have multiple rows or/and
+                        columns of text. Leading and trailing blanks are trimmed.
+                        In their columns, texts are left-justified.
+                        <link linkend="math_rendering_features_in_graphic">LaTeX expressions</link>
+                        delimited with "$...$" are supported.
+                    </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>axes_handle</term>
                 <listitem>
-                    <para>an optional handle, to specify the axes for which the label is set.</para>
+                    <para>
+                        Handle of the axes whose x|y|z label must be set or updated.
+                        By default, the current axes is processed. Otherwise, the given axes
+                        is set as and remains the current one after returning from
+                        <literal>x|y|zlabel()</literal>.
+                    </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>[property_name, property_value,...]</term>
+                <term>property_name, property_value,...</term>
                 <listitem>
-                    <para>an optional sequence of name-value pairs, to specify the text properties of the label
-                        (related to the text properties described <link linkend="text_properties">here</link>).
+                    <para>
+                        unlimited series of pairs of property name (word) and the respective value
+                        to assign to it. The available properties are related to
+                        <link linkend="label_properties">labels properties</link>). Some of them
+                        have an alias that can be used as well with <literal>x|y|zlabel()</literal>:
                     </para>
-                    <para>The available properties for x-y-zlabel are:
+                    <para>
+                        <table border="1">
+                            <tr>
+                                <th align="left">visible</th>
+                                <th></th>
+                                <td>
+                                    <literal>"on"</literal> or <literal>"off"</literal>.
+                                    If <literal>"off"</literal>, the label (and its box) still
+                                    exists but is not displayed.
+                        </td>
+                            </tr>
+                            <tr>
+                                <th align="left">fontsize</th>
+                                <th align="left">font_size</th>
+                                <td>
+                                    Scalar positive number specifying the size of displayed
+                                    characters. default = 1. For any non-integer size, the font is
+                                    scaled accordingly and anti-aliased (made a bit foggy).
+                                </td>
+                            </tr>
+                            <tr>
+                                <th align="left">fontname</th>
+                                <th align="left">font_style</th>
+                                <td>
+                                    Ten font names are available (case and space unsensitive string),
+                                    or their related id number:
+                                    <table>
+                                        <tr>
+                                            <td>0</td><td>"courrier"</td><td></td>
+                                            <td>2</td><td>"times"</td><td></td>
+                                            <td>6</td><td>"helvetica"</td>
+                                        </tr>
+                                        <tr>
+                                            <td>1</td><td>"symbol"</td><td></td>
+                                            <td>3</td><td>"times italic"</td><td></td>
+                                            <td>7</td><td>"helvetica italic"</td>
+                                        </tr>
+                                        <tr>
+                                            <td></td><td></td><td></td>
+                                            <td>4</td><td>"times bold"</td><td></td>
+                                            <td>8</td><td>"helvetica bold"</td>
+                                        </tr>
+                                        <tr>
+                                            <td></td><td></td><td></td>
+                                            <td>5</td><td>"times bold italic"</td><td></td>
+                                            <td>9</td><td>"helvetica bold italic"</td>
+                                        </tr>
+                                    </table>
+                                    <para>
+                                        For instance, 3, "3", "times italic", "timesitalic" or
+                                        "TimesItalic" are equivalent.
+                                    </para>
+                                    <para>
+                                        Other fonts can be loaded with <literal>xlfont()</literal>
+                                        and used.
+                                    </para>
+                                </td>
+                            </tr>
+                            <tr>
+                                <th align="left">color</th>
+                                <th align="left">font_foreground</th>
+                                <td>
+                                    Color of the text of the label (*).
+                                </td>
+                            </tr>
+                            <tr>
+                                <th align="left">position</th>
+                                <th></th>
+                                <td>
+                                    Vector of coordinates of the label's anchor, in data unit.
+                                    The anchor is the lower-left corner of the box of
+                                    the label (when horizontal). Note: This property can't be set
+                                    with a console-oriented syntax.
+                                </td>
+                            </tr>
+                            <tr>
+                                <th align="left">rotation</th>
+                                <th align="left">font_angle</th>
+                                <td>
+                                    Direct (anti-clockwise) angle of the label's block, in degrees,
+                                    horizontal = 0°.
+                                    The lower-left corner of the box bounding the horizontal label
+                                    is used as pivot (fixed point).
+                                </td>
+                            </tr>
+                            <tr>
+                                <th align="left">box</th>
+                                <th></th>
+                                <td>
+                                    "off" | "on": hides or displays a box around the block of text
+                                    of the label.
+                                </td>
+                            </tr>
+                            <tr>
+                                <th align="left">edgecolor</th>
+                                <th align="left">foreground</th>
+                                <td>
+                                    Color of the border of the box (if any)(*). The box is then
+                                    automatically turned "on".
+                                </td>
+                            </tr>
+                            <tr>
+                                <th align="left">background</th>
+                                <th align="left">backgroundcolor</th>
+                                <td>
+                                    Filling color of the box background, behind the text (*).
+                                    The box is then automatically turned "on".
+                                </td>
+                            </tr>
+                            <tr>
+                                <th align="left">tag</th>
+                                <th></th>
+                                <td>
+                                    String or matrix of strings: Custom literal identifier of the label.
+                                </td>
+                            </tr>
+                        </table>
+                    </para>
+                    <para>
+                        (*) Any color can be specified by any of the following:
                         <itemizedlist>
                             <listitem>
-                                <para>
-                                    <literal>"visible"</literal>: <literal>"on"</literal> or <literal>"off"</literal>
-                                </para>
-                            </listitem>
-                            <listitem>
-                                <para>
-                                    <literal>"fontsize", "font_size"</literal>: size of font (constant)
-                                </para>
-                            </listitem>
-                            <listitem>
-                                <para>
-                                    <literal>"fontname", "font_style"</literal>: ten font names are available
-                                    (case unsensitive string or related id number):
-                                    "courrier" | 0, "symbol" | 1, "times" | 2, "times italic" | 3,
-                                    "times bold" | 4, "times bold italic" | 5, "helvetica" | 6,
-                                    "helvetica italic" | 7, "helvetica bold" | 8, "helvetica bold italic" | 9.
-                                </para>
-                            </listitem>
-                            <listitem>
-                                <para>
-                                    <literal>"rotation", "font_angle"</literal>: angle in degrees (constant)
-                                </para>
-                            </listitem>
-                            <listitem>
-                                <para>
-                                    <literal>"position"</literal>: position of label (2d vector)
-                                </para>
+                                Its numerical or literal index in the current colormap
+                                (like 13 or "13"). Special values whatever is the colormap:
+                                -1 for black, -2 for white.
                             </listitem>
                             <listitem>
-                                <para>
-                                    <literal>"color", "font_foreground"</literal>:
-                                    the color of font (a string value chosen among
-                                    <literal>["red","green","blue","cyan","magenta","yellow","black","white"]</literal>,
-                                    or a RGB matrix value)
-                                </para>
+                                Its name as a string, if it is a predefined
+                                <link linkend="color_list">listed color</link>. For colors among
+                                the short list
+                                ["red","green","blue","cyan","magenta","yellow","black","white"],
+                                shortened names are supported, like "m" for magenta or "k"
+                                for "black".
                             </listitem>
                             <listitem>
-                                <para>
-                                    <literal>"edgecolor", "foreground"</literal>:
-                                    the color of line around the text (a string value chosen among
-                                    <literal>["red","green","blue","cyan","magenta","yellow","black","white"]</literal>,
-                                    or a RGB matrix value)
-                                </para>
+                                Its "#RRGGBB" hexadecimal code, as a string.
                             </listitem>
                             <listitem>
-                                <para>
-                                    <literal>"backgroundcolor", "background"</literal>:
-                                    the color of background around the text (a string value chosen among
-                                    <literal>["red","green","blue","cyan","magenta","yellow","black","white"]</literal>,
-                                    or a RGB matrix value)
-                                </para>
+                                the [r,g,b] row of its Red/Green/Blue 0 ≤ r,g,b ≤ 1 intensities.
+                                This syntax can't be used in console-oriented mode.
                             </listitem>
                         </itemizedlist>
                     </para>
     </refsection>
     <refsection role="description">
         <title>Description</title>
-        <para>xlabel, ylabel, zlabel are used to label the x-, y-, and z-axis, respectively.
+        <para>
+            xlabel, ylabel, zlabel are used to label the x|y|z-axis, respectively, or
+            to change properties of existing labels.
         </para>
-        <para>Each label appears beneath its respective axis in a two-dimensional
-            plot and to the side or beneath the axis in a three-dimensional plot.
+        <para>
+            Each of these functions can be called with a functional syntax like
+            <literal>xlabel("My title", "fontsize", 3)</literal> or with an equivalent
+            console-oriented syntax like <literal>xlabel "My title" fontsize 3</literal>.
+            However, [r,g,b] row color and [x,y] coordinates specifications can't be used
+            in console-oriented syntaxes.
         </para>
+        <warning>
+            When an axes handle is specified as the target axes, it becomes the current axes
+            and remains as is after leaving x|y|zlabel().
+        </warning>
     </refsection>
     <refsection role="examples">
         <title>Examples</title>
         <programlisting role="example"><![CDATA[
 t = linspace(-2*%pi, 2*%pi, 30);
+plotframe([0 0 1 1])
 
-subplot(2,1,1);
-plot(t, sin(t), "r");
-xlabel("t", "fontsize", 2);
-ylabel("sin(t)");
-axes_handle = gca();
+subplot(2,1,1)
+plot(t, sin(t), "color", "orange")
+xlabel "Elapsed time" fontsize 2
+ylabel sin(t)
+ax1 = gca();
 
-subplot(2,1,2);
-plot(t, cos(t), "b");
-xlabel("t", "fontsize", 2);
-ylabel("cos(t)", "fontsize", 6, "color", "blue");
+subplot(2,1,2)
+plot(t, cos(t), "b")
+xlabel $time_{eigen}$  fontsize 4
+ylabel cos(t) fontsize 4.5 color blue
+ylabel edgecolor r background grey95
 
-ylabel(axes_handle, "sin(t)", "fontsize", 6, "color", "red");
+ylabel(ax1, "fontsize", 4)
+// Now ax1 is the current axes:
+ylabel color orange  rotation -90
 ]]>     </programlisting>
         <scilab:image>
-            t = linspace(-2*%pi, 2*%pi, 50);
-            subplot(2,1,1);
-            plot(t, sin(t), "r");
-            xlabel("t", "fontsize", 2);
-            ylabel("sin(t)");
-            axes_handle = gca();
-            subplot(2,1,2);
-            plot(t, cos(t), "b");
-            xlabel("t", "fontsize", 2);
-            ylabel("cos(t)", "fontsize", 6, "color", "blue");
-            ylabel(axes_handle, "sin(t)", "fontsize", 6, "color", "red");
+            t = linspace(-2*%pi, 2*%pi, 30);
+            plotframe([0 0 1 1])
+
+            subplot(2,1,1)
+            plot(t, sin(t), "color", "orange")
+            xlabel "Elapsed time" fontsize 2
+            ylabel sin(t)
+            ax1 = gca();
+
+            subplot(2,1,2)
+            plot(t, cos(t), "b")
+            xlabel $time_{eigen}$  fontsize 4
+            ylabel cos(t) fontsize 4.5 color blue
+            ylabel edgecolor r background grey95
+
+            ylabel(ax1, "fontsize", 4)
+            // Now ax1 is the current axes:
+            ylabel color orange  rotation -90
         </scilab:image>
     </refsection>
     <refsection role="see also">
@@ -163,11 +298,67 @@ ylabel(axes_handle, "sin(t)", "fontsize", 6, "color", "red");
                 <link linkend="label_properties">label_properties</link>
             </member>
             <member>
+                <link linkend="title">title</link>
+            </member>
+            <member>
                 <link linkend="xtitle">xtitle</link>
             </member>
             <member>
-                <link linkend="title">title</link>
+                <link linkend="ieditor">Interactive editor</link>
+            </member>
+            <member>
+                <link linkend="xstring">xstring</link>
+            </member>
+            <member>
+                <link linkend="color_list">color_list</link>
+            </member>
+            <member>
+                <link linkend="color">color</link>
+            </member>
+            <member>
+                <link linkend="xlfont">xlfont</link>
+            </member>
+            <member>
+                <link linkend="set">set</link>
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revdescription>
+                    <itemizedlist>
+                        <listitem>
+                            The <literal>label</literal> becomes optional, to update only properties.
+                        </listitem>
+                        <listitem>
+                            The full list of Scilab predefined colors names can now be used,
+                            as well as hexadecimal #RRGGBB colors codes.
+                        </listitem>
+                        <listitem>
+                            Console-oriented usages are now possible, specifying any color index,
+                            font id, font size, or box angle as a string like "13" instead of 13,
+                            excepted for [r,g,b] and [x,y,z] position.
+                        </listitem>
+                        <listitem>
+                            When a non-integer font size is specified,
+                            <literal>.fractional_font</literal> is now automatically turned "on".
+                            It is conversely forced to "off" for any input integer font size.
+                        </listitem>
+                        <listitem>
+                            Any specified font name is now space-insensitive.
+                        </listitem>
+                        <listitem>
+                            New property <literal>box="on"|"off"</literal> added.
+                        </listitem>
+                        <listitem>
+                            New property <literal>tag</literal> added.
+                        </listitem>
+                    </itemizedlist>
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
diff --git a/scilab/modules/graphics/help/ja_JP/annotation/title.xml b/scilab/modules/graphics/help/ja_JP/annotation/title.xml
deleted file mode 100644 (file)
index dec7b0a..0000000
+++ /dev/null
@@ -1,308 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-
- * Copyright (C) INRIA - Farid Belahcene
-
- *
-
-
- * 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="ja" xml:id="title">
-
-    <refnamediv>
-
-        <refname>title</refname>
-
-        <refpurpose>グラフィックウインドウにタイトルを表示する</refpurpose>
-
-    </refnamediv>
-
-    <refsynopsisdiv>
-
-        <title>呼び出し手順</title>
-
-        <synopsis>title(my_title)
-
-            title(my_title,&lt;Property&gt;)
-
-            title(&lt;axes_handle&gt;,&lt;my_title&gt;,&lt;Property&gt;)
-
-        </synopsis>
-
-    </refsynopsisdiv>
-
-    <refsection>
-
-        <title>引数</title>
-
-        <variablelist>
-
-            <varlistentry>
-
-                <term>my_title</term>
-
-                <listitem>
-
-                    <para>文字列, 表示するタイトル</para>
-
-                </listitem>
-
-            </varlistentry>
-
-            <varlistentry>
-
-                <term>&lt;Property&gt;</term>
-
-                <listitem>
-
-                    <para>
-
-                        このオプション引数は一連の命令の対<literal>{PropertyName,PropertyValue}</literal>
-
-                        を表します.この命令は作成したタイトルに適用される
-
-                        グローバルオブジェクトのプロパティを定義します.
-
-                    </para>
-
-                </listitem>
-
-            </varlistentry>
-
-            <varlistentry>
-
-                <term>&lt;axes_handle&gt;</term>
-
-                <listitem>
-
-                    <para>このオプションの引数により,
-
-                        カレントの軸(<link linkend="gca">gca</link>参照)ではなく,
-
-                        <literal>axes_handle</literal> により指定された軸の内側に
-
-                        強制的にタイトルが表示されるようになります.
-
-                    </para>
-
-                </listitem>
-
-            </varlistentry>
-
-        </variablelist>
-
-    </refsection>
-
-    <refsection>
-
-        <title>説明</title>
-
-        <para>
-
-            <literal>title</literal> はタイトルをグラフィックウインドウに表示します.
-
-        </para>
-
-        <para>
-
-            <literal>Property</literal> 引数はタイトルをカスタマイズする際に使用されます.
-
-            以下に利用可能な全てのオプションのリストを示します.
-
-        </para>
-
-        <variablelist>
-
-            <varlistentry>
-
-                <term>Property :</term>
-
-                <listitem>
-
-                    <para>
-
-                        <literal>backgroundcolor :</literal>
-
-                        このフィールドはボックスを塗りつぶす際に使用される色を有します.
-
-                        この値は(カレントのカラーマップの)色インデックスである必要があります.
-
-                    </para>
-
-                    <para>
-
-                        <literal>color :</literal> このフィールドはタイトルのテキストを
-
-                        表示する際に使用される色を有します.
-
-                        この値は(カレントのカラーマップの)色インデックスである必要があります.
-
-                    </para>
-
-                    <para>
-
-                        <literal>edgecolor :</literal>
-
-                        このフィールドはボックスの周囲の線を表示する際に使用される色を有します.
-
-                        この値は(カレントのカラーマップの)色インデックスである必要があります.
-
-                    </para>
-
-                    <para>
-
-                        <literal>fontname :</literal> 以下の10種類のフォントが利用可能です
-
-                        (大文字小文字を区別しない文字列または関連するid番号):
-
-                        "courrier" | 0, "symbol" | 1, "times" | 2, "times italic" | 3,
-
-                        "times bold" | 4, "times bold italic" | 5, "helvetica" | 6,
-
-                        "helvetica italic" | 7, "helvetica bold" | 8, "helvetica bold italic" | 9.
-
-                    </para>
-
-                    <para>
-
-                        <literal>fontsize :</literal>
-
-                        fontsizeプロパティはタイトルの大きさの型を選択する際に使用されます.
-
-                        整数 >= 0 とする必要があります.
-
-                    </para>
-
-                    <para>
-
-                        <literal>position :</literal>
-
-                        この2次元ベクトルによりタイトルを画面上にマニュアルで配置することができます.
-
-                        位置は軸のデータ単位で保存されます.
-
-                    </para>
-
-                    <para>
-
-                        <literal>rotation :</literal>このスカラー値により
-
-                        タイトルを回転することができます.
-
-                        フォントは指定した角度(単位:度)で反時計回りに回転されます.
-
-                    </para>
-
-                    <para>
-
-                        <literal>visible :</literal>このフィールド
-
-                        はタイトルの visible プロパティを有します.
-
-                        この値は, "on" または "off"とします. デフォルトでタイトルは可視で,
-
-                        このプロパティの値は "on" です. "off" の場合, タイトルは画面に表示されません.
-
-                    </para>
-
-                </listitem>
-
-            </varlistentry>
-
-        </variablelist>
-
-    </refsection>
-
-    <refsection>
-
-        <title>例</title>
-
-        <programlisting role="example"><![CDATA[
-
-// 複数のプロパティを指定してタイトルを表示
-
-title('my title');
-
-// フォントの色を変更
-
-title('my title','color','blue');
-
-// ボックスの周囲の色を変更
-
-title('my title','edgecolor','red');
-
-// タイトルの位置を変更
-
-title('my title','position',[0.3 0.8]);
-
-// フォントの大きさを変更
-
-title('my title','fontsize',3);
-
-// 回転
-
-title('my title','rotation',90);
-
-
-
-// これらの変更を以下の命令のみで行う:
-
-title('my title','color','blue','edgecolor','red','fontsize',3,'rotation',90,'position',[0.3 0.8]);
-
- ]]></programlisting>
-
-        <scilab:image>
-
-            title('my title','color','blue','edgecolor','red','fontsize',3,'rotation',90,'position',[0.3 0.8]);
-
-
-
-        </scilab:image>
-
-    </refsection>
-
-    <refsection role="see also">
-
-        <title>参照</title>
-
-        <simplelist type="inline">
-
-            <member>
-
-                <link linkend="label_properties">label_properties</link>
-
-            </member>
-
-            <member>
-
-                <link linkend="titlepage">titlepage</link>
-
-            </member>
-
-            <member>
-
-                <link linkend="xtitle">xtitle</link>
-
-            </member>
-
-        </simplelist>
-
-    </refsection>
-
-</refentry>
-
diff --git a/scilab/modules/graphics/help/ja_JP/annotation/xlabel.xml b/scilab/modules/graphics/help/ja_JP/annotation/xlabel.xml
deleted file mode 100644 (file)
index 53a50e9..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) DIGITEO - 2011 - Allan CORNET
- * Copyright (C) 2016 - Samuel GOUGEON
- * 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:ns3="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="xlabel" xml:lang="ja">
-    <refnamediv>
-        <refname>xlabel</refname>
-        <refpurpose>x軸ラベルを付加する</refpurpose>
-    </refnamediv>
-    <refnamediv xml:id="ylabel">
-        <refname>ylabel</refname>
-        <refpurpose>y軸ラベルを付加する</refpurpose>
-    </refnamediv>
-    <refnamediv xml:id="zlabel">
-        <refname>zlabel</refname>
-        <refpurpose>z軸ラベルを付加する</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>呼び出し手順</title>
-        <synopsis>
-            xlabel([axes_handle], label, [property_name, property_value,...])
-            ylabel([axes_handle], label, [property_name, property_value,...])
-            zlabel([axes_handle], label, [property_name, property_value,...])
-        </synopsis>
-    </refsynopsisdiv>
-    <refsection role="parameters">
-        <title>引数</title>
-        <variablelist>
-            <varlistentry>
-                <term>label</term>
-                <listitem>
-                    <para>文字列, ラベルの値を有する</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>axes_handle</term>
-                <listitem>
-                    <para>
-                        オプションのハンドルで, ラベルを設定する軸を指定します.
-                    </para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>[property_name, property_value,...]</term>
-                <listitem>
-                    <para>
-                        オプションの名前-値の組の並びで,
-                        (<link linkend="text_properties">ここ</link>に記述されたtextプロパティに関係する)
-                        ラベルのtextプロパティを指定します.
-                    </para>
-                    <para>利用可能なx-y-zラベルのプロパティを以下に示します:
-                        <itemizedlist>
-                            <listitem>
-                                <para>
-                                    <literal>"visible"</literal>: <literal>"on"</literal> または <literal>"off"</literal>
-                                </para>
-                            </listitem>
-                            <listitem>
-                                <para>
-                                    <literal>"fontsize", "font_size"</literal>: フォントの大きさ (定数)
-                                </para>
-                            </listitem>
-                            <listitem>
-                                <para>
-                                    <literal>"fontname", "font_style"</literal>: 利用可能な10種類のフォント名
-                                    (大文字小文字を区別しない文字列または関係するid番号):
-                                    "courrier" | 0, "symbol" | 1, "times" | 2, "times italic" | 3,
-                                    "times bold" | 4, "times bold italic" | 5, "helvetica" | 6,
-                                    "helvetica italic" | 7, "helvetica bold" | 8, "helvetica bold italic" | 9.
-                                </para>
-                            </listitem>
-                            <listitem>
-                                <para>
-                                    <literal>"rotation", "font_angle"</literal>: 角度 (単位:deg) (定数)
-                                </para>
-                            </listitem>
-                            <listitem>
-                                <para>
-                                    <literal>"position"</literal>: ラベルの位置 (2次元ベクトル)
-                                </para>
-                            </listitem>
-                            <listitem>
-                                <para>
-                                    <literal>"color", "font_foreground"</literal>: フォントの色
-                                    (<literal>["red","green","blue","cyan","magenta","yellow",
-                                        "black","white"]
-                                    </literal>
-                                    ,または RGB行列の値から選んだ文字列の値)
-                                </para>
-                            </listitem>
-                            <listitem>
-                                <para>
-                                    <literal>"edgecolor", "foreground"</literal>:
-                                    テキスト周囲の線の色
-                                    (<literal>["red","green","blue","cyan","magenta","yellow",
-                                        "black","white"]
-                                    </literal>
-                                    ,または RGB行列の値から選んだ文字列の値)
-                                </para>
-                            </listitem>
-                            <listitem>
-                                <para>
-                                    <literal>"backgroundcolor", "background"</literal>:
-                                    テキスト周囲の背景色
-                                    (<literal>["red","green","blue","cyan","magenta","yellow",
-                                        "black","white"]
-                                    </literal>
-                                    ,または RGB行列の値から選んだ文字列の値)
-                                </para>
-                            </listitem>
-                        </itemizedlist>
-                    </para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection role="description">
-        <title>説明</title>
-        <para>
-            xlabel, ylabel, zlabel は,それぞれ,x, y, およびz軸に
-            ラベルを付けるために使用します.
-        </para>
-        <para>
-            このラベルは2次元プロットでは対応する軸の下,
-            3次元プロットでは軸の横または下に表示されます.
-        </para>
-    </refsection>
-    <refsection role="examples">
-        <title>例</title>
-        <programlisting role="example"><![CDATA[
-t = linspace(-2*%pi, 2*%pi, 30);
-
-subplot(2,1,1);
-plot(t, sin(t), "r");
-xlabel("t", "fontsize", 2);
-ylabel("sin(t)");
-axes_handle = gca();
-
-subplot(2,1,2);
-plot(t, cos(t), "b");
-xlabel("t", "fontsize", 2);
-ylabel("cos(t)", "fontsize", 6, "color", "blue");
-
-ylabel(axes_handle, "sin(t)", "fontsize", 6, "color", "red");
-]]>     </programlisting>
-        <scilab:image>
-            t = linspace(-2*%pi, 2*%pi, 50);
-            subplot(2,1,1);
-            plot(t, sin(t), "r");
-            xlabel("t", "fontsize", 2);
-            ylabel("sin(t)");
-            axes_handle = gca();
-            subplot(2,1,2);
-            plot(t, cos(t), "b");
-            xlabel("t", "fontsize", 2);
-            ylabel("cos(t)", "fontsize", 6, "color", "blue");
-            ylabel(axes_handle, "sin(t)", "fontsize", 6, "color", "red");
-        </scilab:image>
-    </refsection>
-    <refsection role="see also">
-        <title>参照</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="label_properties">label_properties</link>
-            </member>
-            <member>
-                <link linkend="xtitle">xtitle</link>
-            </member>
-            <member>
-                <link linkend="title">title</link>
-            </member>
-        </simplelist>
-    </refsection>
-</refentry>
diff --git a/scilab/modules/graphics/help/pt_BR/annotation/title.xml b/scilab/modules/graphics/help/pt_BR/annotation/title.xml
deleted file mode 100644 (file)
index cc87bc5..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA - Farid Belahcene
- *
- * 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: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="title" xml:lang="pt">
-    <refnamediv>
-        <refname>title</refname>
-        <refpurpose>Exibe um título em uma janela gráfica</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>Seqüência de Chamamento</title>
-        <synopsis>title(my_title)
-            title(my_title,&lt;Property&gt;)
-            title(&lt;axes_handle&gt;,&lt;my_title&gt;,&lt;Property&gt;)
-        </synopsis>
-    </refsynopsisdiv>
-    <refsection>
-        <title>Parâmetros</title>
-        <variablelist>
-            <varlistentry>
-                <term>my_title</term>
-                <listitem>
-                    <para>string, o título a ser exibido </para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>&lt;Property&gt;</term>
-                <listitem>
-                    <para>argumento opcional, representa um par de declarações
-                        <literal>{PropertyName,PropertyValue}</literal>que definem
-                        propriedades de objetos globais aplicadas o título criado.
-                    </para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>&lt;axes_handle&gt;</term>
-                <listitem>
-                    <para>este argumento opcional força o título a parecer dentro dos
-                        eixos selecionados dados por <literal>axes_handle</literal> ao invés
-                        dos eixos correntes (ver <link linkend="gca">gca</link>).
-                    </para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection>
-        <title>Descrição</title>
-        <para>
-            <literal>title</literal> exibe um título numa janela de gráficos.
-        </para>
-        <para>Os argumentos Property (propriedade) devem ser usados para
-            customizar o título. Aqui está uma lista completa das opções
-            disponíveis.
-        </para>
-        <variablelist>
-            <varlistentry>
-                <term>Property :</term>
-                <listitem>
-                    <para>
-                        <literal>backgroundcolor :</literal> este campo contém a cor
-                        utilizada para preencher a caixa, se houver. Seu valor deve ser um
-                        índice de cor (relativo ao mapa de cores corrente).
-                    </para>
-                    <para>
-                        <literal>color :</literal> este campo contém a cor a ser
-                        utilizada para exibir o texto de título. Seu valor deve ser um
-                        índice de cor (relativo ao mapa de cores corrente).
-                    </para>
-                    <para>
-                        <literal>edgecolor :</literal>este campo contém a cor usada
-                        para exibir a linha ao redor da caixa, se houver alguma. Seu valor
-                        deve ser um índice de cor (relativo ao mapa de cores corrente).
-                    </para>
-                    <para>
-                        <literal>fontname :</literal> sete fontes diferentes estão
-                        disponíveis: "Courrier", "Symbol", "Times", "Times Italic", "Times
-                        Bold", "Definida pelo Usuário". A propriedade font_size é um índice
-                        no intervalo [0 6] que é associado a um dos nomes anteriores.
-                    </para>
-                    <para>
-                        <literal>fontsize :</literal> a propriedade é utilizada para
-                        selecionar o tipo de tamanho do título. Seu valor deve ser um
-                        inteiro entre 0 e 5 que significa 8pt, 10pt, 12pt, 14pt, 18pt e
-                        24pt.
-                    </para>
-                    <para>
-                        <literal>position :</literal> este vetor 2d permite que você
-                        posicione manualmente o título na tela. A posição é armazenada nas
-                        unidades de dados dos eixos.
-                    </para>
-                    <para>
-                        <literal>rotation :</literal> escalar que permite que você
-                        gire o título. A fonte é girada em sentido anti-horário com o ângulo
-                        dado em graus.
-                    </para>
-                    <para>
-                        <literal>visible :</literal> este campo contém o valor da
-                        propriedade visible para o título. Pode ser "on" ou "off". Por
-                        padrão, o título é visível, a propriedade é "on" . Se "off" , o
-                        título não é exibido na tela.
-                    </para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection>
-        <title>Exemplos</title>
-        <programlisting role="example"><![CDATA[
-// exibindo um título com várias propriedades
-title('meu título');
-// mudando a cor de fonte do título
-title('meu título','color','blue');
-// mudando a cor ao redor da caixa
-title('meu título','edgecolor','red');
-// mudando a posição do título
-title('meu título','position',[0.3 0.8]);
-// mudando o tamanho da fonte
-title('meu título','fontsize',3);
-// dando uma rotação
-title('meu título','rotation',90);
-
-// podemos realizar todas essas modificações apenas pela instrução abaixo:
-title('meu título','color','blue','edgecolor','red','fontsize',3,'rotation',90,'position',[0.3 0.8]);
- ]]></programlisting>
-    </refsection>
-    <refsection role="see also">
-        <title>Ver Também</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="label_properties">label_properties</link>
-            </member>
-            <member>
-                <link linkend="titlepage">titlepage</link>
-            </member>
-            <member>
-                <link linkend="xtitle">xtitle</link>
-            </member>
-        </simplelist>
-    </refsection>
-</refentry>
index 728e6a1..4939434 100644 (file)
@@ -1,6 +1,7 @@
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 // Copyright (C) 2004-2006 - INRIA - Farid Belahcene
 // Copyright (C) 2012 - 2016 - Scilab Enterprises
+// Copyright (C) 2013, 2019 - 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.
 
 function TitleLabel(varargin)
     // TITLELABEL function
-    // is used by the functions title, xlabel, ylabel, zlabel
+    // This internal is used by the functions title, xlabel, ylabel, zlabel
 
     [lhs,rhs]=argn(0);
 
-    //CurColor = 0; // current color used if no color specified via LineSpec
-    // nor PropertyName
-
     ListArg = varargin;
     titlelabel = ListArg(1);
-    ListArg(1) = null(); // remove this parameter from the list
+    fname = strsubst(titlelabel,"_","");// for error messages
+    ListArg(1) = null();  // remove this parameter from the list
+    arginPos = 0;                       // to compute argin # for error messages
 
     //detect and set the current axes now:
     if type(ListArg(1)) == 9
@@ -28,8 +28,9 @@ function TitleLabel(varargin)
         if (hdle.type == "Axes")
             sca(ListArg(1));
             ListArg(1) = null(); // remove this parameter from the list
+            arginPos = 1;
         else
-            warning(msprintf(gettext("%s: Wrong type for input argument #%d: Axes handle expected.\n"),"TitleLabel",1));
+            warning(msprintf(gettext("%s: Wrong type for input argument #%d: Axes handle expected.\n"), fname, 1));
             return;
         end
     end
@@ -37,19 +38,21 @@ function TitleLabel(varargin)
     monaxe = gca();
 
     nv = size(ListArg);
-    // detect and set the string now:
-    if  type(ListArg(1))== 10 & modulo(nv,2) == 1 then
-        st = ListArg(1);
-        execstr("monaxe."+ titlelabel +".text"+"=st")
-        ListArg(1) = null();
-        nv=nv-1
-    else
-        error(msprintf(gettext("%s: Wrong size or type for input argument #%d: string expected.\n"),"TitleLabel",1));
+    if  modulo(nv,2) == 1 then
+        // detect and set the string now:
+        if  type(ListArg(1))== 10
+            st = ListArg(1);
+            execstr("monaxe."+ titlelabel +".text"+"=st")
+            ListArg(1) = null();
+            nv=nv-1
+            arginPos = arginPos + 1;
+        else
+            msg = gettext("%s: Wrong size or type for input argument #%d: string expected.\n")
+            error(msprintf(msg, fname, shift+1));
+        end
     end
 
-    T=[];
-
-    //given_data = 2;
+    T = [];
 
     for k=1:nv
         T(k,1) = type(ListArg(k))
@@ -67,10 +70,9 @@ function TitleLabel(varargin)
         end
     end
 
-
     // delay the drawing commands
     // smart drawlater
-    current_figure=gcf();
+    current_figure = gcf();
     cur_draw_mode = current_figure.immediate_drawing;
     current_figure.immediate_drawing = "off";
 
@@ -82,18 +84,270 @@ function TitleLabel(varargin)
     // P1 is the position of the first PropertyName field.
     Property = P1;
 
-    current_titlelabel=get(monaxe,titlelabel)
-
+    current_titlelabel = get(monaxe,titlelabel)
+    arginPos = arginPos + 1;  // position of the propertyName in the caller argin list
     while ((Property <> 0) & (Property <= nv-1))
-        setTitleLabelProperty(ListArg(Property),ListArg(Property+1),current_titlelabel,current_figure,cur_draw_mode)
-        //setLabelProperty(ListArg(Property),ListArg(Property+1),monaxe.title,current_figure,cur_draw_mode)
+        setTitleLabelProperty(ListArg(Property),ListArg(Property+1),current_titlelabel,current_figure,cur_draw_mode, fname, arginPos)
         Property = Property+2;
+        arginPos = arginPos+2;
     end
 
     //postponed drawings are done now !
     // smart drawnow
     ResetFigureDDM(current_figure, cur_draw_mode);
+endfunction
+
+// ============================================================================
+
+function [PName] = getTitleLabelPropertyNam(PropertyName,current_figure,cur_draw_mode)
+    // Copyright INRIA
+    // GETTITLELABELPROPERTYNAME function
+    // is used by the functions title, xlabel, ylabel, zlabel
+    // this function gets the matlab properties names and repalce them by the
+    // equivalent scilab properties names, using Table and TableEQ
+
+    //conversion to lower format
+    str = convstr(PropertyName);
+
+
+    Table    = [ "tag" "visible" "box" "fontname" "fontangle" "fontsize" ..
+    "rotation" "position" "color" "edgecolor" "backgroundcolor" ];
+
+    TableEQ =  [ "tag" "visible" "fill_mode" "font_style" "font_style" "font_size" ..
+    "font_angle" "position" "font_foreground" "foreground" "background"];
+
+    opt1=[];
+    k=find(part(Table,1:length(str))==str);
+
+    if (isempty(k)) then
+        // Scilab names are allowed too...
+        k=find(part(TableEQ,1:length(str))==str);
+        if ~isempty(k) then
+            PName = TableEQ(k(1))
+            return;
+        end
+    end
+
+    if (k == [])
+        warning("Error in Property specification : bad argument specified");
+        PName=[];
+        ResetFigureDDM(current_figure, cur_draw_mode);
+        return;
+    elseif (size(k,"*") > 1)
+        warning("Ambiguous text property");
+        PName=[];
+        ResetFigureDDM(current_figure, cur_draw_mode);
+        return;
+    end
+
+    opt = Table(k);
+    for i=1:length(str)
+        if part(opt,i) <> part(str,i)
+            break;
+        end
+    end
+
+    opt1 = [opt1 k];
+
+    str = part(str,i:length(str));
+
+    if (size(opt1,"*") > 1)
+        warning("Error in Property specification : too much properties specified");
+        ResetFigureDDM(current_figure, cur_draw_mode);
+        return;
+    end
+
+    PName = TableEQ(opt1);
+endfunction
+
+// ============================================================================
+
+function [fail] = setTitleLabelProperty(PropertyName,PropertyValue,titlelabel,current_figure,cur_draw_mode, fname, arginPos)
+    // SETTITLELABELPROPERTY function
+    // is used by the functions title, xlabel, ylabel, zlabel
+    // This function sets the title (or x_, y_, z_label) properties
+
+    fail=0;
+
+    //conversion to lower format
+    str = convstr(PropertyName);
+
+    //Property = ['foreground' 'clipping'];
+
+    [PName] = getTitleLabelPropertyNam(str, current_figure, cur_draw_mode)
 
+    if (PName==[])
+        ResetFigureDDM(current_figure, cur_draw_mode);
+        return;
+    end
+
+    /////////////////////////
+    if  PName == "font_size"       // <=> fontsize
+        /////////////////////////
+        ok =  size(PropertyValue,"*")==1 & or(type(PropertyValue)==[1 10]);
+        if ok & type(PropertyValue)==10
+            if isnum(PropertyValue)
+                PropertyValue =evstr(PropertyValue)   // literal fontsize, like "3"
+            else
+                ok = %f
+            end
+        end
+        ok = ok & PropertyValue >= 0;
+        if ~ok
+            warning(msprintf(gettext("%s: Argument #%d: Positive scalar number expected.\n"), fname, arginPos+1));
+            ResetFigureDDM(current_figure, cur_draw_mode);
+            return;
+        end
+        titlelabel.font_size = PropertyValue
+        if PropertyValue~=int(PropertyValue)
+            titlelabel.fractional_font = "on"
+        else
+            titlelabel.fractional_font = "off"
+        end
+        return
+
+        /////////////////////////
+    elseif  PName == "font_angle"  // <=> rotation
+        /////////////////////////
+        ok =  size(PropertyValue,"*")==1 & or(type(PropertyValue)==[1 10]);
+        if ok & type(PropertyValue)==10
+            if isnum(PropertyValue)
+                PropertyValue =evstr(PropertyValue)   // literal angle, like "30"
+            else
+                ok = %f;
+            end
+        end
+        if ~ok
+            warning(msprintf(gettext("%s: Argument #%d: Scalar number expected.\n"), fname, arginPos+1));
+            ResetFigureDDM(current_figure, cur_draw_mode);
+            return;
+        end
+        titlelabel.auto_rotation = "off"
+        newPropertyValue = modulo(PropertyValue,360)
+        titlelabel.font_angle = 360 - newPropertyValue
+        return
+
+        /////////////////////////
+    elseif or(PName==["font_foreground" "foreground" "background"])
+        /////////////////////////
+        //  "font_foreground"  <=>  color
+        //  "foreground"       <=>  edgecolor, foregroundcolor
+        //  "background"       <=>  backgroundcolor
+        index = []
+        ok = %f
+        if size(PropertyValue,"*")==1
+            if type(PropertyValue)==10 & isnum(PropertyValue) // literal index like "14"
+                PropertyValue = evstr(PropertyValue)
+            end
+        end
+        colors = iscolor(PropertyValue);
+        ok = size(colors,1)==1 & ~isnan(colors(1))
+        if ok
+            if size(colors,2)==3    // RGB
+                index = addcolor(colors)
+            else
+                index = colors
+            end
+        else
+            if type(PropertyValue)==10 & size(PropertyValue,"*")==1 & ..
+                grep("none", "/^"+PropertyValue+"/", "r") <> []
+                // 'none' selected
+                titlelabel.color_mode = 0; // <=> - colormap(1) and not black at all!!
+                return
+            end
+        end
+        if ~ok
+            msg = gettext("%s: Argument #%d: Wrong color specification.\n");
+            warning(msprintf(msg, fname, arginPos+1));
+            ResetFigureDDM(current_figure, cur_draw_mode);
+            return
+        end
+        if or(PName==["foreground" "background"])
+            titlelabel.fill_mode = "on"
+        end
+        titlelabel(PName) = index;
+
+        /////////////////////////
+    elseif  PName == "text"        // <=> string
+        /////////////////////////
+        if (type(PropertyValue) == 10)
+            titlelabel.text = PropertyValue;
+            return
+        else
+            warning(msprintf(_("%s: Wrong type for input argument #%d: string expected.\n"), fname, arginPos+1));
+            ResetFigureDDM(current_figure, cur_draw_mode);
+            return;
+        end
+
+        /////////////////////////
+    elseif  PName == "position"        // <=> position, à completer: la position par rapport à z n'est pas pris en compte, de plus le vecteur position doit contenir des coordonnées utilisateur (coordonnées selon l'axe)
+        /////////////////////////
+
+        if type(PropertyValue) == 1 & size(PropertyValue,"*")<=3
+            titlelabel.auto_position = "off";
+            titlelabel.position = PropertyValue ;
+            return
+        else
+            warning(msprintf(gettext("%s: Wrong size or type for input argument #%d: A real matrix expected.\n"), fname, arginPos+1));
+            ResetFigureDDM(current_figure, cur_draw_mode);
+            return;
+        end
+
+        /////////////////////////
+    elseif  or(PName == ["visible" "fill_mode"])    // <=> visible | box
+        /////////////////////////
+
+        if type(PropertyValue) == 10
+            if or(PropertyValue == ["off" "of"])
+                titlelabel(PName) = "off";
+                return
+            elseif PropertyValue == "on"
+                titlelabel(PName) = "on";
+                return
+            end
+        end
+        msg = gettext("%s: Argument #%d: ''on'' or ''off'' expected.\n")
+        warning(msprintf(msg, fname, arginPos+1));
+        ResetFigureDDM(current_figure, cur_draw_mode);
+
+
+        /////////////////////////
+    elseif  PName == "tag"     //
+        /////////////////////////
+        if type(PropertyValue) == 10
+            titlelabel.tag = PropertyValue;
+        else
+            msg = gettext("%s: Argument #%d: Text expected.\n")
+            warning(msprintf(msg, fname, arginPos+1));
+            ResetFigureDDM(current_figure, cur_draw_mode);
+        end
+
+        /////////////////////////
+    elseif PName == "font_style"     // <=> fontangle
+        /////////////////////////
+        fonts = ["courrier" "symbol" "times" "timesitalic" "timesbold" ..
+        "timesbolditalic" "helvetica" "helveticaitalic" "helveticabold"..
+        "helveticabolditalic" ]
+        if typeof(PropertyValue) == "string" & isnum(PropertyValue)
+            PropertyValue = evstr(PropertyValue)    // Literal id, like "3"
+        end
+        if typeof(PropertyValue) == "string"
+            PropertyValue = strsubst(convstr(PropertyValue,"l"), " ", "");
+            if or(PropertyValue == fonts)
+                titlelabel.font_style = find(fonts==PropertyValue)-1;
+            else
+                warning(msprintf(_("%s: Wrong value for input argument #%d: At least one ""%s"" expected.\n"), fname, arginPos+1, "font"));
+                ResetFigureDDM(current_figure, cur_draw_mode);
+                return;
+            end
+        elseif typeof(PropertyValue) == "constant" & or(PropertyValue==(0:9))
+            titlelabel.font_style = PropertyValue;
+        else
+            warning(msprintf(_("%s: Wrong type for input argument #%d: A real matrix or a string matrix expected.\n"), fname, arginPos+1));
+            ResetFigureDDM(current_figure, cur_draw_mode);
+            return;
+        end
+    end
 
 endfunction
 
diff --git a/scilab/modules/graphics/macros/getTitleLabelPropertyNam.sci b/scilab/modules/graphics/macros/getTitleLabelPropertyNam.sci
deleted file mode 100644 (file)
index a9075de..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2004-2006 - INRIA - Farid Belahcene
-// 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.
-
-function [PName] = getTitleLabelPropertyNam(PropertyName,current_figure,cur_draw_mode)
-    // Copyright INRIA
-    // GETTITLELABELPROPERTYNAME function
-    // is used by the functions title, xlabel, ylabel, zlabel
-    // this function gets the matlab properties names and repalce them by the equivalent scilab properties names, using Table and TableEQ
-
-    //conversion to lower format
-    str = convstr(PropertyName);
-
-
-    Table    = [ "visible" "fontname" "fontangle" "fontsize" "rotation" ..
-    "position" "color" "edgecolor" "backgroundcolor" ];
-
-    TableEQ =  [ "visible" "font_style" "font_style" "font_size" "font_angle" ..
-    "position" "font_foreground" "foreground" "background"]
-
-    //TableEQ =  [ 'visible' 'font_style' 'font_style' 'font_size' 'font_angle' ..
-    //           'position' 'foreground' 'background' ..
-    //         'visible' 'fill_mode' 'auto_position' 'auto_rotation']; // equivalent Table
-
-    opt1=[];
-    k=find(part(Table,1:length(str))==str);
-
-    if (isempty(k)) then
-        // Scilab names are allowed too...
-        k=find(part(TableEQ,1:length(str))==str);
-        if ~isempty(k) then
-            PName = TableEQ(k(1))
-            return;
-        end
-    end
-
-    if (k == [])
-        warning("Error in Property specification : bad argument specified");
-        PName=[];
-        ResetFigureDDM(current_figure, cur_draw_mode);
-        return;
-    elseif (size(k,"*") > 1)
-        warning("Ambiguous text property");
-        PName=[];
-        ResetFigureDDM(current_figure, cur_draw_mode);
-        return;
-    end
-
-    opt = Table(k);
-    for i=1:length(str)
-        if part(opt,i) <> part(str,i)
-            break;
-        end
-    end
-
-    opt1 = [opt1 k];
-
-    str = part(str,i:length(str));
-
-    if (size(opt1,"*") > 1)
-        warning("Error in Property specification : too much properties specified");
-        ResetFigureDDM(current_figure, cur_draw_mode);
-        return;
-    end
-
-    PName = TableEQ(opt1);
-endfunction
diff --git a/scilab/modules/graphics/macros/setTitleLabelProperty.sci b/scilab/modules/graphics/macros/setTitleLabelProperty.sci
deleted file mode 100644 (file)
index bd85d44..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2004-2006 - INRIA - Farid Belahcene
-// Copyright (C) 2013 - Samuel GOUGEON
-// 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.
-
-function [fail] = setTitleLabelProperty(PropertyName,PropertyValue,titlelabel,current_figure,cur_draw_mode)
-    // SETTITLELABELPROPERTY function
-    // is used by the functions title, xlabel, ylabel, zlabel
-    // This function sets the title (or x_, y_, z_label) properties
-
-    fail=0;
-
-    //conversion to lower format
-    str = convstr(PropertyName);
-
-    //Property = ['foreground' 'clipping'];
-
-    [PName] = getTitleLabelPropertyNam(str, current_figure, cur_draw_mode)
-
-    if (PName==[])
-        ResetFigureDDM(current_figure, cur_draw_mode);
-        return;
-    end
-
-    select PName
-
-        /////////////////////////
-    case "font_size"       // <=> fontsize
-        /////////////////////////
-
-        if (type(PropertyValue)<>1 | size(PropertyValue,"*")<>1)
-            warning(msprintf(gettext("%s: Wrong type for input argument #%d: A real matrix expected.\n"),"setTitleLabelProperty",2));
-            ResetFigureDDM(current_figure, cur_draw_mode);
-            return;
-        end
-
-        titlelabel.font_size = PropertyValue
-        return
-
-
-        /////////////////////////
-    case "font_angle"  // <=> rotation
-        /////////////////////////
-        if (type(PropertyValue)<>1 | size(PropertyValue,"*")<>1)
-            warning(msprintf(gettext("%s: Wrong type for input argument #%d: A real matrix expected.\n"),"setTitleLabelProperty",2));
-            ResetFigureDDM(current_figure, cur_draw_mode);
-            return;
-        end
-
-        titlelabel.auto_rotation = "off"
-        newPropertyValue = modulo(PropertyValue,360)
-        titlelabel.font_angle = 360 - newPropertyValue
-        return
-
-
-        /////////////////////////
-    case "font_foreground"         // <=> color or edgecolor
-        /////////////////////////
-
-        if (type(PropertyValue) == 10)
-            index = getColorIndex(PropertyValue);
-
-            ColorVal   = ["red" "green" "blue" "cyan" "magenta" "yellow" "black" "black" "white"]
-
-            if index < 10
-                titlelabel.font_foreground = color(ColorVal(index));
-            elseif index == 10  // 'none' selected
-                titlelabel.color_mode = 0; // <=> - colormap(1) and not black at all!!
-            else
-                warning(msprintf(gettext("%s: Wrong type for input argument #%d: Vector or index in the colormap expected.\n"),"setTitleLabelProperty",2));
-                ResetFigureDDM(current_figure, cur_draw_mode);
-                return;
-            end
-        elseif (type(PropertyValue) == 1) // we entered plot(x,y,'Color',[R,G,B])
-
-            if (size(PropertyValue,"*")==3)
-                titlelabel.font_foreground = addcolor(PropertyValue);
-            else
-                titlelabel.font_foreground = PropertyValue;
-            end
-
-        else
-            warning(msprintf(gettext("%s: Wrong type for input argument #%d: Vector or index in the colormap expected.\n"),"setTitleLabelProperty",2));
-            ResetFigureDDM(current_figure, cur_draw_mode);
-            return;
-        end
-
-
-        /////////////////////////
-    case "foreground"        // <=> foregroundcolor
-        /////////////////////////
-
-        if (type(PropertyValue) == 10)
-            index = getColorIndex(PropertyValue);
-
-            ColorVal   = ["red" "green" "blue" "cyan" "magenta" "yellow" "black" "black" "white"]
-
-            if index < 10
-                titlelabel.fill_mode = "on"
-                titlelabel.foreground = color(ColorVal(index));
-            elseif index == 10  // 'none' selected
-                titlelabel.color_mode = 0; // <=> - colormap(1) and not black at all!!
-            else
-                warning(msprintf(gettext("%s: Wrong type for input argument #%d: Vector or index in the colormap expected.\n"),"setTitleLabelProperty",2));
-                ResetFigureDDM(current_figure, cur_draw_mode);
-                return;
-            end
-        elseif (type(PropertyValue) == 1) // we entered plot(x,y,'Color',[R,G,B])
-
-            if (size(PropertyValue,"*")==3)
-                titlelabel.fill_mode = "on"
-                titlelabel.foreground = addcolor(PropertyValue);
-            else
-                titlelabel.fill_mode = "on"
-                titlelabel.foreground = PropertyValue;
-            end
-        else
-            warning(msprintf(gettext("%s: Wrong type for input argument #%d: Vector or index in the colormap expected.\n"),"setTitleLabelProperty",2));
-            ResetFigureDDM(current_figure, cur_draw_mode);
-            return;
-        end
-
-
-        /////////////////////////
-    case "background"        // <=> backgroundcolor
-        /////////////////////////
-
-        if (type(PropertyValue) == 10)
-
-            index = getColorIndex(PropertyValue);
-
-            ColorVal   = ["red" "green" "blue" "cyan" "magenta" "yellow" "black" "black" "white"]
-
-            if index < 10
-                titlelabel.fill_mode = "on"
-                titlelabel.background = color(ColorVal(index));
-            elseif index == 10  // 'none' selected
-                titlelabel.color_mode = 0; // <=> - colormap(1) and not black at all!!
-            else
-                warning(msprintf(gettext("%s: Wrong type for input argument #%d: Vector or index in the colormap expected.\n"),"setTitleLabelProperty",2));
-                ResetFigureDDM(current_figure, cur_draw_mode);
-                return;
-            end
-        elseif (type(PropertyValue) == 1) // we entered plot(x,y,'Color',[R,G,B])
-
-            if (size(PropertyValue,"*")==3)
-                titlelabel.fill_mode = "on"
-                titlelabel.background = addcolor(PropertyValue);
-            else
-                titlelabel.fill_mode = "on"
-                titlelabel.background = PropertyValue;
-            end
-        else
-            warning(msprintf(gettext("%s: Wrong type for input argument #%d: Vector or index in the colormap expected.\n"),"setTitleLabelProperty",2));
-            ResetFigureDDM(current_figure, cur_draw_mode);
-            return;
-        end
-
-
-        /////////////////////////
-    case "text"        // <=> string
-        /////////////////////////
-        if (type(PropertyValue) == 10)
-            titlelabel.text = PropertyValue;
-            return
-        else
-            warning(msprintf(_("%s: Wrong type for input argument #%d: string expected.\n"),"setTitleLabelProperty",2));
-            ResetFigureDDM(current_figure, cur_draw_mode);
-            return;
-        end
-
-
-        /////////////////////////
-    case "position"        // <=> position, à completer: la position par rapport à z n'est pas pris en compte, de plus le vecteur position doit contenir des coordonnées utilisateur (coordonnées selon l'axe)
-        /////////////////////////
-
-        if type(PropertyValue) == 1 & size(PropertyValue,"*")<=3
-            titlelabel.auto_position = "off";
-            titlelabel.position = PropertyValue ;
-            return
-        else
-            warning(msprintf(gettext("%s: Wrong size or type for input argument #%d: A real matrix expected.\n"),"setTitleLabelProperty",2));
-            ResetFigureDDM(current_figure, cur_draw_mode);
-            return;
-        end
-
-
-
-        /////////////////////////
-    case "visible"           // <=> visible
-        /////////////////////////
-
-        if type(PropertyValue) == 10
-            if or(PropertyValue == ["off" "of"])
-                titlelabel.visible = "off";
-                return
-            elseif PropertyValue == "on"
-                titlelabel.visible = "on";
-                return
-            else
-                warning(_("Incorrect input: ..."));
-                ResetFigureDDM(current_figure, cur_draw_mode);
-                return;
-            end
-        else
-            warning(msprintf(_("%s: Wrong type for input argument #%d: string expected.\n"),"setTitleLabelProperty",2));
-            ResetFigureDDM(current_figure, cur_draw_mode);
-            return;
-        end
-
-
-        /////////////////////////
-    case "font_style"     // <=> fontangle
-        /////////////////////////
-        fonts = ["courrier" "symbol" "times" "times italic" "times bold" ..
-        "times bold italic" "helvetica" "helvetica italic" "helvetica bold"..
-        "helvetica bold italic" ]
-        if typeof(PropertyValue) == "string"
-            PropertyValue = convstr(PropertyValue,"l")
-            if or(PropertyValue == fonts)
-                titlelabel.font_style = find(fonts==PropertyValue)-1;
-            else
-                warning(msprintf(_("%s: Wrong value for input argument #%d: At least one ""%s"" expected.\n"),"setTitleLabelProperty",2, "font"));
-                ResetFigureDDM(current_figure, cur_draw_mode);
-                return;
-            end
-        elseif typeof(PropertyValue) == "constant" & or(PropertyValue==(0:9))
-            titlelabel.font_style = PropertyValue;
-        else
-            warning(msprintf(_("%s: Wrong type for input argument #%d: A real matrix or a string matrix expected.\n"),"setTitleLabelProperty",2));
-            ResetFigureDDM(current_figure, cur_draw_mode);
-            return;
-        end
-
-    end
-
-endfunction
-
-
-function k = getIndexInStringTable(pattern, table)
-
-    str =  convstr(pattern);
-    k = find(part(table,1:length(str))==str);
-
-endfunction
-
-
diff --git a/scilab/modules/graphics/tests/unit_tests/xyzlabel_title.tst b/scilab/modules/graphics/tests/unit_tests/xyzlabel_title.tst
new file mode 100644 (file)
index 0000000..8b64729
--- /dev/null
@@ -0,0 +1,105 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2019 - 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.
+// 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.
+// =============================================================================
+
+// <-- TEST WITH GRAPHIC -->
+// <-- ENGLISH IMPOSED -->
+// <-- NO CHECK REF -->
+
+clf reset
+plotframe([0 0 1 1]);
+ax = gca();
+t = "Title à";
+funs = list(xlabel, ylabel, zlabel, title);
+axes = ["x_label" "y_label" "z_label" "title"];
+for i = 1:4
+    fun = funs(i);
+    label = ax(axes(i));
+    fun(t, "visible","off");
+    assert_checkequal(label.visible, "off");
+    fun(t, "visible","on");
+    assert_checkequal(label.visible, "on");
+
+    // Fonts
+    fonts = ["courrier" "symbol" "times" "times italic" "times bold" ..
+             "times bold italic" "helvetica" "helvetica italic" ..
+             "helvetica bold" "helvetica bold italic"];
+    for prop = ["fontname" "font_style"]
+        for j = 1:10
+            fun(t, prop, fonts(j));
+            assert_checkequal(label.font_style, j-1);
+        end
+        for j = 1:10
+            fun(t, prop, j-1);
+            assert_checkequal(label.font_style, j-1);
+        end
+    end
+
+    // Sizes
+    values =  [0.5 1 2 2.7 6];
+    for p = ["font_size" "fontsize"]
+        for v = values
+            fun(t, p, v)
+            assert_checkequal(label.font_size, v);
+            if v~=int(v)
+                assert_checkequal(label.fractional_font, "on");
+            end
+        end
+    end
+
+    // Colors
+    props = ["font_foreground" "color"
+             "foreground"  "edgecolor"
+             "background" "backgroundcolor" ];
+    values = list("r", "green", "grey70", -1, -2, 12, "15", "#AA285D", [255,150,50]/255);
+    h = hex2dec
+    cols = [ color("red") color("green") color("grey70"), -1, -2, 12, 15 ..
+             color(h("AA"),h("28"),h("5D")), color(255,150,50) ];
+    for p = props
+        for k = 1:3
+            for m = 1:size(values)
+                fun(t, p(k), values(m));
+                assert_checkequal(label(props(k,1)), cols(m));
+            end
+        end
+    end
+
+    // tag
+    // ---
+    t = string(rand(1,1)*100);
+    fun("tag",t);
+    assert_checkequal(label("tag"), t);
+
+    // box
+    // ---
+    val = ["off" "on" "off"];
+    for v = val
+        fun("box", v);
+        assert_checkequal(label("fill_mode"), v);
+    end
+
+    // position
+    xy = (0.3:0.1:0.6)'*[1 1]
+    for p = xy'
+        fun("position", p)
+        assert_checkequal(label.position, p')
+    end
+
+    // label's rotation
+    angles = [-90 -20 0 155 450];
+    for p = ["rotation" "font_angle"]
+        for a = angles
+            fun(p,a)
+            aref = 360 - modulo(a,360);
+            assert_checkalmostequal(label.font_angle, aref)
+        end
+    end
+end
index 5f65431..034f6bc 100644 (file)
@@ -1658,7 +1658,6 @@ getColorIndex
 getLineSpec
 getPlotPropertyName
 getSurfPropertyName
-getTitleLabelPropertyNam
 get_figure_handle
 getcolor
 ghdl2tree
@@ -1701,7 +1700,6 @@ secto3d
 setDefaultColor
 setPlotProperty
 setSurfProperty
-setTitleLabelProperty
 seteventhandler
 springcolormap
 subplot
index a24709f..5472735 100644 (file)
@@ -837,9 +837,9 @@ lighting_3.png=4db104cec73db5309f073b24c2d740e1
 linear_interpn_1.png=6097d912048862430be0c7efc1cb5715
 linear_interpn_2.png=babfba25d7f0743ed8a6f6618379fba9
 locate_1.png=12b128890d9e8e2336d8db9d64d8dfcb
-lqe_1.png=6998d2cb2b3cb41b367d983b18dd17f1
-lqg_1.png=14a7c678dad15cad4fc6f3ee55e9f3fd
-lqg_2.png=2e36ecf8ee7566963a9683f68063692f
+lqe_1.png=39cd8f90954e2b934b4926badcd56f7b
+lqg_1.png=3e8627090476b38335a391eb831767a6
+lqg_2.png=d0a7523f9ddee9c5f11c06682ff1b0c6
 lqr_1.png=269d7421a9d109d37259c9739612dd21
 lsq_splin_1.png=35722a6a58a3c9afd427b0bb23f1382a
 mapsound_1.png=d53857560735f383a3e074b5546d1b7f
@@ -1048,7 +1048,7 @@ tan_1.png=7ed3a609064320b0ee99e0cfe612d8cf
 tanh_1.png=5840b9271a8ec32413927548050b6bdf
 taucs_chget_1.png=de0b7d8f19e3b65daab09bd1eddadfd9
 text_properties_1.png=0e89c2e3ef82bc25441ef577e5ea69c6
-title_1.png=43bf4550c7c9b2de76ddd4eddb479b2b
+title_1.png=b9585cbcb451167770fbd917f3444ecf
 titlepage_1.png=917be99c9df0964672daa45c284de115
 titlepage_en_US_2.png=4442891fd6f287a8fb39b92006ff40c5
 titlepage_fr_FR_1.png=f76157d643854ea8716178823dd2680e
@@ -1081,7 +1081,7 @@ xfpolys_3.png=e7d0e541d182062f243f90d111f7ecde
 xfrect_1.png=17ac92d176dfc56c91f7321423523ed7
 xgetech_1.png=302937507487b5bbfbe401ff9e5ea2df
 xgrid_1.png=1e49a2c7efa08eeed42aee791c3f1959
-xlabel_1.png=ba2339f34c8dddbba3032c16dd8378b4
+xlabel_1.png=bee964cc91798c12f372b3d354d9c7d0
 xnumb_1.png=e2966910792ea6c60caf87dc7d25f856
 xpoly_1.png=f54ce2ba82e1125456e9efd2b74d1005
 xpoly_2.png=56e4bf7c2fbf668f6c3da56bd3bd64ea
index 1000094..e3423dd 100644 (file)
Binary files a/scilab/modules/helptools/images/title_1.png and b/scilab/modules/helptools/images/title_1.png differ
index f722711..fd28658 100644 (file)
Binary files a/scilab/modules/helptools/images/xlabel_1.png and b/scilab/modules/helptools/images/xlabel_1.png differ