summaryrefslogtreecommitdiffstats
path: root/scilab/modules/graphics
diff options
context:
space:
mode:
authorClément David <clement.david@esi-group.com>2021-07-15 15:50:48 +0200
committerClément David <clement.david@esi-group.com>2021-07-15 15:50:48 +0200
commit81a9cc049332de0c712cf56da585fcd25c8e59e3 (patch)
treef365c25a05c1782a16b2985bf7481116c106952d /scilab/modules/graphics
parentb0937f19e4b8ddf416ca9a9a433bcbbd3f4ef2c0 (diff)
parent90b4ecb9b57ac6ad4e00d4a99b0d8bd1a6424403 (diff)
downloadscilab-master.zip
scilab-master.tar.gz
Merge remote-tracking branch 'origin/6.1'HEADmaster
Change-Id: I5d26fc380a28efe0bb6d0096fe9684b274b55bfe
Diffstat (limited to 'scilab/modules/graphics')
-rw-r--r--scilab/modules/graphics/Makefile.in2
-rw-r--r--scilab/modules/graphics/demos/technical/technical.dem.gateway.sce1
-rw-r--r--scilab/modules/graphics/help/en_US/2d_plot/loglog.xml180
-rw-r--r--scilab/modules/graphics/help/en_US/2d_plot/plot.xml137
-rw-r--r--scilab/modules/graphics/help/en_US/2d_plot/plot2d.xml21
-rw-r--r--scilab/modules/graphics/help/en_US/2d_plot/scatter.xml594
-rw-r--r--scilab/modules/graphics/help/en_US/2d_plot/semilogx.xml175
-rw-r--r--scilab/modules/graphics/help/en_US/2d_plot/semilogy.xml175
-rw-r--r--scilab/modules/graphics/help/en_US/3d_plot/scatter3d.xml660
-rw-r--r--scilab/modules/graphics/help/en_US/axes_operations/replot.xml11
-rw-r--r--scilab/modules/graphics/help/en_US/color_management/colormap.xml138
-rw-r--r--scilab/modules/graphics/help/en_US/color_management/getcolor.xml54
-rw-r--r--scilab/modules/graphics/help/en_US/color_management/uigetcolor.xml93
-rw-r--r--scilab/modules/graphics/help/en_US/load_save/xsave.xml67
-rw-r--r--scilab/modules/graphics/help/en_US/polygon/polyline_properties.xml2
-rw-r--r--scilab/modules/graphics/help/en_US/property/get.xml503
-rw-r--r--scilab/modules/graphics/help/en_US/property/set.xml30
-rw-r--r--scilab/modules/graphics/help/fr_FR/axes_operations/replot.xml8
-rw-r--r--scilab/modules/graphics/help/images/getcolor.pngbin0 -> 6483 bytes
-rw-r--r--scilab/modules/graphics/help/images/uigetcolor_1.pngbin0 -> 10944 bytes
-rw-r--r--scilab/modules/graphics/help/images/uigetcolor_RGB.pngbin0 -> 15650 bytes
-rw-r--r--scilab/modules/graphics/help/ja_JP/2d_plot/plot.xml137
-rw-r--r--scilab/modules/graphics/help/ja_JP/2d_plot/plot2d.xml21
-rw-r--r--scilab/modules/graphics/help/ja_JP/axes_operations/replot.xml6
-rw-r--r--scilab/modules/graphics/help/ja_JP/color_management/colormap.xml248
-rw-r--r--scilab/modules/graphics/help/ja_JP/color_management/getcolor.xml122
-rw-r--r--scilab/modules/graphics/help/ja_JP/color_management/uigetcolor.xml35
-rw-r--r--scilab/modules/graphics/help/ja_JP/load_save/xsave.xml142
-rw-r--r--scilab/modules/graphics/help/ja_JP/polygon/polyline_properties.xml2
-rw-r--r--scilab/modules/graphics/help/ja_JP/property/get.xml447
-rw-r--r--scilab/modules/graphics/help/pt_BR/2d_plot/plot.xml140
-rw-r--r--scilab/modules/graphics/help/pt_BR/axes_operations/replot.xml6
-rw-r--r--scilab/modules/graphics/help/pt_BR/color_management/colormap.xml111
-rw-r--r--scilab/modules/graphics/help/pt_BR/color_management/getcolor.xml57
-rw-r--r--scilab/modules/graphics/help/pt_BR/load_save/xsave.xml57
-rw-r--r--scilab/modules/graphics/help/pt_BR/property/get.xml187
-rw-r--r--scilab/modules/graphics/help/ru_RU/2d_plot/loglog.xml192
-rw-r--r--scilab/modules/graphics/help/ru_RU/2d_plot/semilogx.xml186
-rw-r--r--scilab/modules/graphics/help/ru_RU/2d_plot/semilogy.xml187
-rw-r--r--scilab/modules/graphics/help/ru_RU/color_management/getcolor.xml114
-rw-r--r--scilab/modules/graphics/includes/InitObjects.h2
-rw-r--r--scilab/modules/graphics/macros/Sfgrayplot.sci2
-rw-r--r--scilab/modules/graphics/macros/Sgrayplot.sci2
-rw-r--r--scilab/modules/graphics/macros/getcolor.sci50
-rw-r--r--scilab/modules/graphics/macros/histplot.sci1
-rw-r--r--scilab/modules/graphics/macros/loglog.sci45
-rw-r--r--scilab/modules/graphics/macros/plot.sci47
-rw-r--r--scilab/modules/graphics/macros/replot.sci4
-rw-r--r--scilab/modules/graphics/macros/scatter.sci59
-rw-r--r--scilab/modules/graphics/macros/scatter3d.sci795
-rw-r--r--scilab/modules/graphics/macros/semilogx.sci41
-rw-r--r--scilab/modules/graphics/macros/semilogy.sci41
-rw-r--r--scilab/modules/graphics/sci_gateway/c/sci_get.c327
-rw-r--r--scilab/modules/graphics/src/c/Axes.c8
-rw-r--r--scilab/modules/graphics/src/c/InitObjects.c26
-rwxr-xr-xscilab/modules/graphics/src/c/getHandleProperty/GetHashTable.c2
-rwxr-xr-xscilab/modules/graphics/src/c/getHandleProperty/SetHashTable.c15
-rw-r--r--scilab/modules/graphics/tests/nonreg_tests/bug_15299.tst34
-rw-r--r--scilab/modules/graphics/tests/nonreg_tests/bug_15481.tst26
-rw-r--r--scilab/modules/graphics/tests/nonreg_tests/bug_16407.tst39
-rw-r--r--scilab/modules/graphics/tests/nonreg_tests/bug_16561.dia.ref15
-rw-r--r--scilab/modules/graphics/tests/nonreg_tests/bug_16561.tst18
-rw-r--r--scilab/modules/graphics/tests/nonreg_tests/bug_16614.tst33
-rw-r--r--scilab/modules/graphics/tests/nonreg_tests/bug_16631.tst23
-rw-r--r--scilab/modules/graphics/tests/unit_tests/scatter.dia.ref222
-rw-r--r--scilab/modules/graphics/tests/unit_tests/scatter.tst146
-rw-r--r--scilab/modules/graphics/tests/unit_tests/scatter3d.tst131
67 files changed, 4450 insertions, 2952 deletions
diff --git a/scilab/modules/graphics/Makefile.in b/scilab/modules/graphics/Makefile.in
index b2c665e..ccf3a3c 100644
--- a/scilab/modules/graphics/Makefile.in
+++ b/scilab/modules/graphics/Makefile.in
@@ -1320,9 +1320,11 @@ NMEDIT = @NMEDIT@
1320OBJDUMP = @OBJDUMP@ 1320OBJDUMP = @OBJDUMP@
1321OBJEXT = @OBJEXT@ 1321OBJEXT = @OBJEXT@
1322OCAMLC = @OCAMLC@ 1322OCAMLC = @OCAMLC@
1323OCAMLCFLAGS = @OCAMLCFLAGS@
1323OCAMLDEP = @OCAMLDEP@ 1324OCAMLDEP = @OCAMLDEP@
1324OCAMLLEX = @OCAMLLEX@ 1325OCAMLLEX = @OCAMLLEX@
1325OCAMLOPT = @OCAMLOPT@ 1326OCAMLOPT = @OCAMLOPT@
1327OCAMLOPTFLAGS = @OCAMLOPTFLAGS@
1326OCAMLYACC = @OCAMLYACC@ 1328OCAMLYACC = @OCAMLYACC@
1327OPENMPI_CC = @OPENMPI_CC@ 1329OPENMPI_CC = @OPENMPI_CC@
1328OPENMPI_CFLAGS = @OPENMPI_CFLAGS@ 1330OPENMPI_CFLAGS = @OPENMPI_CFLAGS@
diff --git a/scilab/modules/graphics/demos/technical/technical.dem.gateway.sce b/scilab/modules/graphics/demos/technical/technical.dem.gateway.sce
index 764d409..16985f9 100644
--- a/scilab/modules/graphics/demos/technical/technical.dem.gateway.sce
+++ b/scilab/modules/graphics/demos/technical/technical.dem.gateway.sce
@@ -16,6 +16,7 @@ subdemolist = [
16"Black-Nichols" , "black.dem.sce" 16"Black-Nichols" , "black.dem.sce"
17"s-grid" , "sgrid.dem.sce" 17"s-grid" , "sgrid.dem.sce"
18"z-grid" , "zgrid.dem.sce" 18"z-grid" , "zgrid.dem.sce"
19"mapsound" , "../../../sound/demos/mapsound.dem.sce"
19]; 20];
20 21
21subdemolist(:,2) = demopath + subdemolist(:,2); 22subdemolist(:,2) = demopath + subdemolist(:,2);
diff --git a/scilab/modules/graphics/help/en_US/2d_plot/loglog.xml b/scilab/modules/graphics/help/en_US/2d_plot/loglog.xml
new file mode 100644
index 0000000..5f9a640
--- /dev/null
+++ b/scilab/modules/graphics/help/en_US/2d_plot/loglog.xml
@@ -0,0 +1,180 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) INRIA - Fabrice Leray
5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
6 * Copyright (C) 2018 - 2019 - Samuel GOUGEON
7 * Copyright (C) 2020 - Stéphane MOTTELET
8 *
9 * This file is hereby licensed under the terms of the GNU GPL v2.0,
10 * pursuant to article 5.3.4 of the CeCILL v.2.1.
11 * This file was originally licensed under the terms of the CeCILL v2.1,
12 * and continues to be available under such terms.
13 * For more information, see the COPYING file which you should have received
14 * along with this program.
15 *
16 -->
17<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
18 xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
19 xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
20 xml:lang="en" xml:id="loglog">
21 <refnamediv>
22 <refname>loglog</refname>
23 <refpurpose>2D logarithmic plot</refpurpose>
24 </refnamediv>
25 <refsynopsisdiv>
26 <title>Syntax</title>
27 <synopsis>
28 loglog // demo
29 loglog(y)
30 loglog(x, y)
31 loglog(x, fun)
32 loglog(x, list(fun, param))
33 loglog(.., LineSpec)
34 loglog(.., LineSpec, GlobalProperty)
35 loglog(x1, y1, LineSpec1, x2,y2,LineSpec2,...xN, yN, LineSpecN, GlobalProperty1,.. GlobalPropertyM)
36 loglog(x1,fun1,LineSpec1, x2,y2,LineSpec2,...xN,funN,LineSpecN, GlobalProperty1, ..GlobalPropertyM)
37 loglog(axes_handle,...)
38 </synopsis>
39 </refsynopsisdiv>
40 <refsection>
41 <title>Arguments</title>
42 <variablelist>
43 <varlistentry>
44 <term>x</term>
45 <listitem>
46 <para>
47 vector or matrix of strictly positive real numbers or integers. If omitted, it is assumed
48 to be the vector <literal>1:n</literal> where <literal>n</literal> is the
49 number of curve points given by the <literal>y</literal> parameter.
50 </para>
51 </listitem>
52 </varlistentry>
53 <varlistentry>
54 <term>y</term>
55 <listitem>
56 <para>
57 vector or matrix of strictly positive real numbers or integers.
58 </para>
59 </listitem>
60 </varlistentry>
61 <varlistentry>
62 <term>fun, fun1, ..</term>
63 <listitem>
64 <para>
65 handle of a function, as in <literal>loglog(x, gamma)</literal>.
66 </para>
67 <para>
68 If the function to plot needs some parameters as input arguments, the
69 function and its parameters can be specified through a list, as in
70 <literal>loglog(x, list(delip, -0.4))</literal>
71 </para>
72 </listitem>
73 </varlistentry>
74 <varlistentry>
75 <term>LineSpec</term>
76 <listitem>
77 <para>This optional argument must be a string that will be used as a
78 shortcut to specify a way of drawing a line. We can have one
79 <literal>LineSpec</literal> per <literal>y</literal> or <literal>{x,y}</literal>
80 previously entered. <literal>LineSpec</literal> options deals with
81 LineStyle, Marker and Color specifiers (see <link linkend="LineSpec">LineSpec</link>).
82 Those specifiers determine the line style, mark style and color of
83 the plotted lines.
84 </para>
85 </listitem>
86 </varlistentry>
87 <varlistentry>
88 <term>GlobalProperty</term>
89 <listitem>
90 <para>This optional argument represents a sequence of couple
91 statements <literal>{PropertyName,PropertyValue}</literal> that defines
92 global objects' properties applied to all the curves created by this
93 plot. For a complete view of the available properties (see
94 <link linkend="GlobalProperty">GlobalProperty</link>).
95 </para>
96 </listitem>
97 </varlistentry>
98 <varlistentry>
99 <term>axes_handle</term>
100 <listitem>
101 <para>This optional argument forces the plot to appear inside the
102 selected axes given by <literal>axes_handle</literal> rather than the
103 current axes (see <link linkend="gca">gca</link>).
104 </para>
105 </listitem>
106 </varlistentry>
107 </variablelist>
108 </refsection>
109 <refsection>
110 <title>Description</title>
111 <para><literal>loglog</literal> plots data using a base 10 logarithmic scale for both x-axis and y-axis. The possible syntaxes and arguments are the same as the <link linkend="plot">plot</link> function besides the condition that values in <term>x</term> and <term>y</term> arguments be strictly positive.
112 </para>
113 <para>If the current axes is not empty and the x-axis or the y-axis has a negative lower bound then its scale will remain linear after the plot.
114 </para>
115 <para>
116 Enter the command <literal>loglog</literal> to see a demo.
117 </para>
118 </refsection>
119 <refsection>
120 <title>Examples</title>
121 <programlisting role="example"><![CDATA[
122 w=logspace(-2,2,1000);
123 s=%i*w;
124 g=[];
125 for alpha=logspace(-2,1,4);
126 g=[g;(1)./(s.^2+alpha*s+1)];
127 end
128 clf("reset")
129
130 loglog(w,abs(g));
131
132 legend(leg)
133 title("$\LARGE \left|s^2/(s^2+\alpha s+1)\right|\mbox{ for }s=i\omega$")
134 xlabel("$\LARGE \omega$") ]]></programlisting>
135 <scilab:image>
136 w=logspace(-2,2,1000);
137 s=%i*w;
138 g=[];
139 for alpha=logspace(-2,1,4);
140 g=[g;(1)./(s.^2+alpha*s+1)];
141 end
142 clf("reset")
143
144 loglog(w,abs(g));
145
146 title("$\LARGE \left|s^2/(s^2+\alpha s+1)\right|\mbox{ for }s=i\omega$")
147 xlabel("$\LARGE \omega$") </scilab:image>
148 </refsection>
149 <refsection role="see also">
150 <title>See also</title>
151 <simplelist type="inline">
152 <member>
153 <link linkend="plot">plot</link>
154 </member>
155 <member>
156 <link linkend="semilogx">semilogx</link>
157 </member>
158 <member>
159 <link linkend="semilogy">semilogy</link>
160 </member>
161 <member>
162 <link linkend="LineSpec">LineSpec</link>
163 </member>
164 <member>
165 <link linkend="GlobalProperty">GlobalProperty</link>
166 </member>
167 </simplelist>
168 </refsection>
169 <refsection role="history">
170 <title>History</title>
171 <revhistory>
172 <revision>
173 <revnumber>6.1.1</revnumber>
174 <revdescription>
175 Function loglog added.
176 </revdescription>
177 </revision>
178 </revhistory>
179 </refsection>
180</refentry>
diff --git a/scilab/modules/graphics/help/en_US/2d_plot/plot.xml b/scilab/modules/graphics/help/en_US/2d_plot/plot.xml
index e97a1a4..ee0a61a 100644
--- a/scilab/modules/graphics/help/en_US/2d_plot/plot.xml
+++ b/scilab/modules/graphics/help/en_US/2d_plot/plot.xml
@@ -3,7 +3,7 @@
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) INRIA - Fabrice Leray 4 * Copyright (C) INRIA - Fabrice Leray
5 * Copyright (C) 2012 - 2016 - Scilab Enterprises 5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
6 * Copyright (C) 2018 - 2019 - Samuel GOUGEON 6 * Copyright (C) 2018 - 2020 - Samuel GOUGEON
7 * 7 *
8 * This file is hereby licensed under the terms of the GNU GPL v2.0, 8 * This file is hereby licensed under the terms of the GNU GPL v2.0,
9 * pursuant to article 5.3.4 of the CeCILL v.2.1. 9 * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -27,12 +27,14 @@
27 plot // demo 27 plot // demo
28 plot(y) 28 plot(y)
29 plot(x, y) 29 plot(x, y)
30 plot(x, fun) 30 plot(x, func)
31 plot(x, list(fun, param)) 31 plot(x, list(func, params))
32 plot(x, polynomial)
33 plot(x, rational)
32 plot(.., LineSpec) 34 plot(.., LineSpec)
33 plot(.., LineSpec, GlobalProperty) 35 plot(.., LineSpec, GlobalProperty)
34 plot(x1, y1, LineSpec1, x2,y2,LineSpec2,...xN, yN, LineSpecN, GlobalProperty1,.. GlobalPropertyM) 36 plot(x1, y1, LineSpec1, x2,y2,LineSpec2,...xN, yN, LineSpecN, GlobalProperty1,.. GlobalPropertyM)
35 plot(x1,fun1,LineSpec1, x2,y2,LineSpec2,...xN,funN,LineSpecN, GlobalProperty1, ..GlobalPropertyM) 37 plot(x1,func1,LineSpec1, x2,y2,LineSpec2,...xN,funcN,LineSpecN, GlobalProperty1, ..GlobalPropertyM)
36 plot(logflag,...) 38 plot(logflag,...)
37 plot(axes_handle,...) 39 plot(axes_handle,...)
38 </synopsis> 40 </synopsis>
@@ -53,21 +55,54 @@
53 <varlistentry> 55 <varlistentry>
54 <term>y</term> 56 <term>y</term>
55 <listitem> 57 <listitem>
56 <para> 58 vector or matrix of real numbers or of integers.
57 vector or matrix of real numbers or of integers. 59 <para/>
58 </para>
59 </listitem> 60 </listitem>
60 </varlistentry> 61 </varlistentry>
61 <varlistentry> 62 <varlistentry>
62 <term>fun, fun1, ..</term> 63 <term>func</term>
63 <listitem> 64 <listitem>
64 <para> 65 <para>
65 handle of a function, as in <literal>plot(x, sin)</literal>. 66 handle of a function, as in <literal>plot(x, sin)</literal>.
67 If the function to plot needs some parameters as input arguments, the
68 function and its parameters can be specified through a list as in
69 <literal>plot(x, list(delip,-0.4))</literal>
66 </para> 70 </para>
71 </listitem>
72 </varlistentry>
73 <varlistentry>
74 <term>polynomial</term>
75 <listitem>
76 Single polynomial or array of polynomials.
77 <para/>
78 </listitem>
79 </varlistentry>
80 <varlistentry>
81 <term>rational</term>
82 <listitem>
83 Single rational or array of rationals.
84 <para/>
85 </listitem>
86 </varlistentry>
87 <varlistentry>
88 <term>y1, y2, y3,..</term>
89 <listitem>
67 <para> 90 <para>
68 If the function to plot needs some parameters as input arguments, the 91 Can be any of the possible input types described above:
69 function and its parameters can be specified through a list, as in 92 <itemizedlist>
70 <literal>plot(x, list(delip, -0.4))</literal> 93 <listitem>
94 vectors or matrices of real numbers or of integers
95 </listitem>
96 <listitem>
97 handle of a function (possibly in a list with its parameters).
98 </listitem>
99 <listitem>
100 polynomials
101 </listitem>
102 <listitem>
103 rationals
104 </listitem>
105 </itemizedlist>
71 </para> 106 </para>
72 </listitem> 107 </listitem>
73 </varlistentry> 108 </varlistentry>
@@ -109,7 +144,7 @@
109 <para> 144 <para>
110 <literal>logflag</literal> must be used after <literal>axes_handle</literal> 145 <literal>logflag</literal> must be used after <literal>axes_handle</literal>
111 (if any) and before the first curve's data <literal>x</literal> or 146 (if any) and before the first curve's data <literal>x</literal> or
112 <literal>y</literal> or <literal>fun</literal>. 147 <literal>y</literal> or <literal>func</literal>.
113 It applies to all curves drawn by the <literal>plot(…)</literal> instruction. 148 It applies to all curves drawn by the <literal>plot(…)</literal> instruction.
114 </para> 149 </para>
115 </listitem> 150 </listitem>
@@ -372,6 +407,7 @@ plot(x, [sin(x) sin(2*x) sin(3*x)])
372 Specifying a macro or a builtin instead of explicit ordinates: 407 Specifying a macro or a builtin instead of explicit ordinates:
373 </emphasis> 408 </emphasis>
374 </para> 409 </para>
410 <para>
375 <programlisting role="example"><![CDATA[ 411 <programlisting role="example"><![CDATA[
376clf 412clf
377subplot(2,2,1) // sin() is a builtin 413subplot(2,2,1) // sin() is a builtin
@@ -433,10 +469,76 @@ title("plot(x, list(myPow,1:5))", "fontsize",3)
433 469
434 gcf().axes_size = [730 500]; 470 gcf().axes_size = [730 500];
435 ]]></scilab:image> 471 ]]></scilab:image>
472 </para>
473 <para/>
474 <para>
475 <emphasis role="bold">
476 Plotting the graph of polynomials or rationals:
477 </emphasis>
478 </para>
479 <para>
480 <programlisting role="example"><![CDATA[
481clf
482s = %s;
483
484// Polynomials
485x = -0.5:0.02:3;
486p = s*[2 ; (s-2) ; (s-1)*(s-2)]
487subplot(1,2,1)
488plot(x, p)
489legend(prettyprint(p,"latex","",%t), 2);
490
491// Rationals
492x = -0.5:0.02:2;
493r = (s-1)*s/(s-7)./[s+1, s-4]
494subplot(1,2,2)
495plot(x, r)
496legend(prettyprint(r,"latex","",%t), 2);
497
498gcf().children.grid = color("grey70")*[1 1]; // grids
499gcf().children.children([1 3]).font_size=3; // legends
500 ]]></programlisting>
501 <screen><![CDATA[
502--> p = s*[2 ; (s-2) ; (s-1)*(s-2)]
503 p =
504 2s
505 -2s +s²
506 2s -3s² +s³
507
508../..
509--> r = (s-1)*s/(s-7)./[s+1, s-4]
510 r =
511 -s +s² -s +s²
512 ---------- -----------
513 -7 -6s +s² 28 -11s +s²
514]]></screen>
515 <scilab:image><![CDATA[
516 s = %s;
517
518 // Polynomials
519 x = -0.5:0.02:3;
520 p = s*[2 ; (s-2) ; (s-1)*(s-2)]
521 subplot(1,2,1)
522 plot(x, p)
523 legend(prettyprint(p,"latex","",%t), 2);
524
525 // Rationals
526 x = -0.5:0.02:2;
527 r = (s-1)*s/(s-7)./[s+1, s-4]
528 subplot(1,2,2)
529 plot(x, r)
530 legend(prettyprint(r,"latex","",%t), 2);
531
532 gcf().children.grid = color("grey70")*[1 1]; // grids
533 gcf().children.children([1 3]).font_size=3; // legends
534 gcf().axes_size = [650 400];
535 ]]></scilab:image>
536 </para>
436 <para/> 537 <para/>
437 <para> 538 <para>
438 <emphasis role="bold">Setting curves simple styles when calling plot():</emphasis> 539 <emphasis role="bold">Setting curves simple styles when calling plot():</emphasis>
439 </para> 540 </para>
541 <para>
440 <programlisting role="example"><![CDATA[ 542 <programlisting role="example"><![CDATA[
441clf 543clf
442t = -%pi:%pi/20:2*%pi; 544t = -%pi:%pi/20:2*%pi;
@@ -459,6 +561,7 @@ plot(t,sin,'ro', t,cos,'g+-', t,gauss,':b')
459 gcf().axes_size = [800 400]; 561 gcf().axes_size = [800 400];
460 ]]> 562 ]]>
461 </scilab:image> 563 </scilab:image>
564 </para>
462 <para/> 565 <para/>
463 <para> 566 <para>
464 Vertical segments between two curves, with automatic colors, and using Global properties 567 Vertical segments between two curves, with automatic colors, and using Global properties
@@ -700,8 +803,8 @@ isoview off
700 <revision> 803 <revision>
701 <revnumber>6.0.2</revnumber> 804 <revnumber>6.0.2</revnumber>
702 <revdescription> 805 <revdescription>
703 Plotting a function fun(x, params) with input parameters is now possible with 806 Plotting a function func(x, params) with input parameters is now possible with
704 plot(x, list(fun, params)). 807 plot(x, list(func, params)).
705 </revdescription> 808 </revdescription>
706 </revision> 809 </revision>
707 <revision> 810 <revision>
@@ -710,6 +813,12 @@ isoview off
710 logflag option added. 813 logflag option added.
711 </revdescription> 814 </revdescription>
712 </revision> 815 </revision>
816 <revision>
817 <revnumber>6.1.1</revnumber>
818 <revdescription>
819 Polynomials and rationals can be plotted.
820 </revdescription>
821 </revision>
713 </revhistory> 822 </revhistory>
714 </refsection> 823 </refsection>
715</refentry> 824</refentry>
diff --git a/scilab/modules/graphics/help/en_US/2d_plot/plot2d.xml b/scilab/modules/graphics/help/en_US/2d_plot/plot2d.xml
index 9ec4b7e..c11da7a 100644
--- a/scilab/modules/graphics/help/en_US/2d_plot/plot2d.xml
+++ b/scilab/modules/graphics/help/en_US/2d_plot/plot2d.xml
@@ -122,26 +122,29 @@
122 <varname>frameflag</varname> and <varname>axesflag</varname>. 122 <varname>frameflag</varname> and <varname>axesflag</varname>.
123 By default, <literal>strf= "081"</literal>. "a", "b" and "c" are: 123 By default, <literal>strf= "081"</literal>. "a", "b" and "c" are:
124 <para/> 124 <para/>
125 <table> 125 <table cellpadding="0">
126 <tr><th>a :</th> 126 <tr valign="top">
127 <th>a :</th>
127 <td>controls the display of captions: 128 <td>controls the display of captions:
128 <table> 129 <table cellpadding="0">
129 <tr><th>x=0 :</th><td>no caption.</td></tr> 130 <tr><th>a=0 :</th><td>no caption.</td></tr>
130 <tr><th>x=1 :</th> 131 <tr><th>a=1 :</th>
131 <td>captions given by the optional argument 132 <td>captions given by the optional argument
132 <varname>leg</varname> are displayed.</td> 133 <varname>leg</varname> are displayed.</td>
133 </tr> 134 </tr>
134 </table> 135 </table>
135 </td> 136 </td>
136 </tr> 137 </tr>
137 <tr><th>b :</th> 138 <tr valign="top">
139 <th>b :</th>
138 <td> 140 <td>
139 <varname>frameflag</varname> integer code in [0,9], 141 <varname>frameflag</varname> integer code in [0,9],
140 controlling the computation the actual coordinate ranges, 142 controlling the computation the actual coordinate ranges,
141 as described below. 143 as described below.
142 </td> 144 </td>
143 </tr> 145 </tr>
144 <tr><th>c :</th> 146 <tr valign="top">
147 <th>c :</th>
145 <td> 148 <td>
146 <varname>axesflag</varname> integer code in [0:5 9], 149 <varname>axesflag</varname> integer code in [0:5 9],
147 controlling the display and position of X and Y axes, 150 controlling the display and position of X and Y axes,
@@ -217,7 +220,7 @@
217 be an integer ranging from 0 to 8. 220 be an integer ranging from 0 to 8.
218 </para> 221 </para>
219 <para> 222 <para>
220 <table border="1" cellpadding="1" cellspacing="0"> 223 <table border="1" cellpadding="2">
221 <tr><th>frameflag</th><th>axes bounds</th> <th>other actions</th></tr> 224 <tr><th>frameflag</th><th>axes bounds</th> <th>other actions</th></tr>
222 <tr align="center"> 225 <tr align="center">
223 <th>0</th> <td>unchanged</td> <td></td></tr> 226 <th>0</th> <td>unchanged</td> <td></td></tr>
@@ -264,7 +267,7 @@
264 <literal>gca().x_location</literal>, and <literal>gca().y_location</literal>, 267 <literal>gca().x_location</literal>, and <literal>gca().y_location</literal>,
265 properties (see <link linkend="axes_properties">axes_properties</link>). 268 properties (see <link linkend="axes_properties">axes_properties</link>).
266 </para> 269 </para>
267 <table border="1" cellpadding="1"> 270 <table border="1" cellpadding="2">
268 <tr><th>axesFlag</th><th>.box</th><th>.axes_visible</th><th>axes position</th><th>comments</th></tr> 271 <tr><th>axesFlag</th><th>.box</th><th>.axes_visible</th><th>axes position</th><th>comments</th></tr>
269 <tr align="center"> 272 <tr align="center">
270 <th>0</th><td>"off"</td><td>["off" "off"]</td><td></td> <td>Naked plot</td></tr> 273 <th>0</th><td>"off"</td><td>["off" "off"]</td><td></td> <td>Naked plot</td></tr>
diff --git a/scilab/modules/graphics/help/en_US/2d_plot/scatter.xml b/scilab/modules/graphics/help/en_US/2d_plot/scatter.xml
index f916f15..68f30bf 100644
--- a/scilab/modules/graphics/help/en_US/2d_plot/scatter.xml
+++ b/scilab/modules/graphics/help/en_US/2d_plot/scatter.xml
@@ -2,8 +2,8 @@
2<!-- 2<!--
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) Scilab Enterprises - 2015 - 2012 - Juergen Koch 4 * Copyright (C) Scilab Enterprises - 2015 - 2012 - Juergen Koch
5 *
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises 5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
6 * Copyright (C) 2020 - Samuel GOUGEON
7 * 7 *
8 * This file is hereby licensed under the terms of the GNU GPL v2.0, 8 * This file is hereby licensed under the terms of the GNU GPL v2.0,
9 * pursuant to article 5.3.4 of the CeCILL v.2.1. 9 * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -24,8 +24,16 @@
24 <refsynopsisdiv> 24 <refsynopsisdiv>
25 <title>Syntax</title> 25 <title>Syntax</title>
26 <synopsis> 26 <synopsis>
27 polyline = scatter(x, y, msizes, mcolors, "fill", marker, &lt;marker_property, value&gt;) 27 scatter() // Example
28 polyline = scatter(axes_handle,...) 28 scatter(x, y)
29 scatter(x, y, msizes)
30 scatter(x, y, msizes, mcolors)
31 scatter(.., "fill")
32 scatter(.., "smallOnTop")
33 scatter(.., marker)
34 scatter(..., &lt;marker_property, value>)
35 scatter(axes, ..)
36 polyline = scatter(..)
29 </synopsis> 37 </synopsis>
30 </refsynopsisdiv> 38 </refsynopsisdiv>
31 <refsection> 39 <refsection>
@@ -41,17 +49,28 @@
41 </listitem> 49 </listitem>
42 </varlistentry> 50 </varlistentry>
43 <varlistentry> 51 <varlistentry>
52 <term>axes</term>
53 <listitem>
54 Handle of the graphical axes in which the scatter plot must be drawn.
55 By default, the current axes is targeted.
56 <para/>
57 </listitem>
58 </varlistentry>
59 <varlistentry>
60 <term>polyline</term>
61 <listitem>
62 Handle of the created polyline.
63 <para/>
64 </listitem>
65 </varlistentry>
66 <varlistentry>
44 <term>msizes</term> 67 <term>msizes</term>
45 <listitem> 68 <listitem>
46 <para> 69 <para>
47 Specifying the sizes of the markers. To plot each marker with equal sizes, 70 Sizes of the markers, as of the area of the circle surrounding the marker,
48 specify <varname>msizes</varname> as a scalar. 71 in point-square. Default value = 36. If it is scalar,
49 To plot each marker with a different size, specify <varname>msizes</varname> 72 the same size is used for all markers. Otherwise <varname>msizes</varname>
50 as a vector with length equal to the length of <varname>x</varname> and 73 and <varname>x</varname> must have the same number of elements.
51 <varname>x</varname>.
52 The units for <varname>msizes</varname> is points squared with a default
53 value of 36 points squared.
54 The size equals the area of the circle surrounding the marker.
55 </para> 74 </para>
56 </listitem> 75 </listitem>
57 </varlistentry> 76 </varlistentry>
@@ -59,18 +78,35 @@
59 <term>mcolors</term> 78 <term>mcolors</term>
60 <listitem> 79 <listitem>
61 <para> 80 <para>
62 Specifying the colors of the markers. 81 Colors of markers. If it is scalar, the same color is used for all markers.
63 To plot each marker with the same color, specify <varname>mcolors</varname> 82 Otherwise, <varname>mcolors</varname> and <varname>x</varname> must have
64 as a string representing a known color, see <link linkend="color_list">color_list</link>. 83 the same number of elements.
65 A color can also be specified by a vector of 3 RGB values between 0 and 1. 84 </para>
66 To plot each marker with a different color, specify <varname>mcolors</varname> 85 <para>
67 as a vector with length equal to the length of <varname>x</varname>. 86 The same color is used for filling the body and drawing the edge of markers.
87 </para>
88 <para>
68 The values of <varname>mcolors</varname> are linearly mapped to the colors 89 The values of <varname>mcolors</varname> are linearly mapped to the colors
69 in the current colormap. 90 in the current colormap.
70 Colors can also by specified by a matrix of RGB values or a vector of 91 </para>
71 strings representing known colors. 92 <para>
72 A matrix of RGB values has 3 columns and the number of rows equals the 93 A color can be specified by one of the following:
73 length of <varname>x</varname>. 94 <itemizedlist>
95 <listitem>
96 Its name, among the predefined names colors
97 (see the <link linkend="color_list">color_list</link>).
98 </listitem>
99 <listitem>
100 Its standard hexadecimal RGB code as a string, like "#A532FB".
101 </listitem>
102 <listitem>
103 A matrix of RGB values with 3 columns and n rows, with Red Green and
104 Blue intensities in [0,1].
105 </listitem>
106 <listitem>
107 Its index in the current color map
108 </listitem>
109 </itemizedlist>
74 The default color is "blue". 110 The default color is "blue".
75 </para> 111 </para>
76 </listitem> 112 </listitem>
@@ -79,11 +115,21 @@
79 <term>"fill"</term> 115 <term>"fill"</term>
80 <listitem> 116 <listitem>
81 <para> 117 <para>
82 This string indicates that the markers are filled with some colors. 118 By default, only the edge of markers is drawn, unless this keyword or the
83 By default, the filling colors are the same as the patterns ones.
84 Both sets of colors can be defined independently by using the properties
85 <varname>"markerFaceColor"</varname> or 119 <varname>"markerFaceColor"</varname> or
86 <varname>"markerBackgroundColor"</varname>. 120 <varname>"markerBackgroundColor"</varname> properties are set.
121 </para>
122 </listitem>
123 </varlistentry>
124 <varlistentry>
125 <term>"smallOnTop"</term>
126 <listitem>
127 <para>
128 When markers have not all the same size and the population of points becomes
129 crowdy, big markers can hide smaller ones located around the same place.
130 This option can be used to avoid such masking effects. Then points are
131 priorly sorted by decreasing sizes, in order to plot the smallest points
132 at the end, on top of bigger ones.
87 </para> 133 </para>
88 </listitem> 134 </listitem>
89 </varlistentry> 135 </varlistentry>
@@ -91,8 +137,8 @@
91 <term>marker</term> 137 <term>marker</term>
92 <listitem> 138 <listitem>
93 <para> 139 <para>
94 Select the type of the marker. The same marker shape is used for all 140 Selects the shape of the markers. The same shape is used for all
95 specified points. The figure below shows the 15 different marker types. 141 specified points. The figure below shows the 15 different marker shapes.
96 </para> 142 </para>
97 <para> 143 <para>
98 <inlinemediaobject> 144 <inlinemediaobject>
@@ -102,181 +148,154 @@
102 </inlinemediaobject> 148 </inlinemediaobject>
103 </para> 149 </para>
104 <para> 150 <para>
105 Marker types are specified by strings, see the table below. 151 Each marker shape is specified either by its index (list above) or by
152 its string symbol (table below).
106 </para> 153 </para>
107 <para> 154 <para>
108 <informaltable border="1"> 155 <informaltable border="1">
109 <tr> 156 <tr><td>Index</td>
110 <td> 157 <td>String</td>
111 String 158 <td>Marker type</td>
112 </td>
113 <td>
114 Marker type
115 </td>
116 </tr> 159 </tr>
117 <tr> 160 <tr>
118 <td> 161 <td>0</td>
119 <literal>"."</literal> 162 <td><literal>"."</literal></td>
120 </td>
121 <td>Point</td> 163 <td>Point</td>
122 </tr> 164 </tr>
123 <tr> 165 <tr>
124 <td> 166 <td>1</td>
125 <literal>"+"</literal> 167 <td><literal>"+"</literal></td>
126 </td>
127 <td>Plus sign</td> 168 <td>Plus sign</td>
128 </tr> 169 </tr>
129 <tr> 170 <tr>
130 <td> 171 <td>2</td>
131 <literal>"x"</literal> 172 <td><literal>"x"</literal></td>
132 </td>
133 <td>Cross</td> 173 <td>Cross</td>
134 </tr> 174 </tr>
135 <tr> 175 <tr>
136 <td> 176 <td>3</td>
137 <literal>"circle plus"</literal> 177 <td><literal>"circle plus"</literal></td>
138 </td>
139 <td>Circle with plus</td> 178 <td>Circle with plus</td>
140 </tr> 179 </tr>
141 <tr> 180 <tr>
142 <td> 181 <td>4</td>
143 <literal>"filled diamond"</literal> 182 <td><literal>"filled diamond"</literal></td>
144 </td>
145 <td>Filled diamond</td> 183 <td>Filled diamond</td>
146 </tr> 184 </tr>
147 <tr> 185 <tr>
148 <td> 186 <td>5</td>
149 <literal>"d"</literal> or 187 <td><literal>"d"</literal> or <literal>"diamond"</literal></td>
150 <literal>"diamond"</literal>
151 </td>
152 <td>Diamond</td> 188 <td>Diamond</td>
153 </tr> 189 </tr>
154 <tr> 190 <tr>
155 <td> 191 <td>6</td>
156 <literal>"^"</literal> 192 <td><literal>"^"</literal></td>
157 </td>
158 <td>Upward-pointing triangle</td> 193 <td>Upward-pointing triangle</td>
159 </tr> 194 </tr>
160 <tr> 195 <tr>
161 <td> 196 <td>7</td>
162 <literal>"v"</literal> 197 <td><literal>"v"</literal></td>
163 </td>
164 <td>Downward-pointing triangle</td> 198 <td>Downward-pointing triangle</td>
165 </tr> 199 </tr>
166 <tr> 200 <tr>
167 <td> 201 <td>8</td>
168 <literal>"diamond plus"</literal> 202 <td><literal>"diamond plus"</literal></td>
169 </td>
170 <td>Diamond with plus</td> 203 <td>Diamond with plus</td>
171 </tr> 204 </tr>
172 <tr> 205 <tr>
173 <td> 206 <td>9</td>
174 <literal>"o"</literal> 207 <td><literal>"o"</literal></td>
175 </td>
176 <td>Circle (default)</td> 208 <td>Circle (default)</td>
177 </tr> 209 </tr>
178 <tr> 210 <tr>
179 <td> 211 <td>10</td>
180 <literal>"*"</literal> 212 <td><literal>"*"</literal></td>
181 </td>
182 <td>Asterisk</td> 213 <td>Asterisk</td>
183 </tr> 214 </tr>
184 <tr> 215 <tr>
185 <td> 216 <td>11</td>
186 <literal>"s"</literal> or 217 <td><literal>"s"</literal> or <literal>"square"</literal></td>
187 <literal>"square"</literal>
188 </td>
189 <td>Square</td> 218 <td>Square</td>
190 </tr> 219 </tr>
191 <tr> 220 <tr>
192 <td> 221 <td>12</td>
193 <literal>"&gt;"</literal> 222 <td><literal>">"</literal></td>
194 </td>
195 <td>Right-pointing triangle</td> 223 <td>Right-pointing triangle</td>
196 </tr> 224 </tr>
197 <tr> 225 <tr>
198 <td> 226 <td>13</td>
199 <literal>"&lt;"</literal> 227 <td><literal>"&lt;"</literal></td>
200 </td>
201 <td>Left-pointing triangle</td> 228 <td>Left-pointing triangle</td>
202 </tr> 229 </tr>
203 <tr> 230 <tr>
204 <td> 231 <td>14</td>
205 <literal>"pentagram"</literal> or 232 <td><literal>"pentagram"</literal> or <literal>"p"</literal></td>
206 <literal>"p"</literal>
207 </td>
208 <td>Five-pointed star</td> 233 <td>Five-pointed star</td>
209 </tr> 234 </tr>
210 </informaltable> 235 </informaltable>
211 </para> 236 </para>
212 </listitem> 237 </listitem>
213 </varlistentry> 238 </varlistentry>
239 </variablelist>
240 <refsect3>
241 <title>Property Name, Value pairs</title>
242 <para>
243 A series of property &lt;Name,Value> pairs can be used to specify
244 the filling color of markers body, the color and thickness of the markers edges,
245 or the points on which a datatip must be created.
246 </para>
247 </refsect3>
248 <variablelist>
214 <varlistentry> 249 <varlistentry>
215 <term>&lt;marker_property, value&gt;</term> 250 <term>"marker",value or "markerStyle",value</term>
216 <listitem>
217 <para>
218 A sequence of property value pairs can be used to specify type, color and
219 line width of the markers.
220 </para>
221 </listitem>
222 </varlistentry>
223 <varlistentry>
224 <term>&lt;"marker", value&gt; or &lt;"markerStyle", value&gt;</term>
225 <listitem> 251 <listitem>
226 <para> 252 <para>
227 Specify the type of the marker, see the table above. 253 Shape of the marker (index or string keyword). See the table above.
228 </para> 254 </para>
229 </listitem> 255 </listitem>
230 </varlistentry> 256 </varlistentry>
231 <varlistentry> 257 <varlistentry>
232 <term>&lt;"markerEdgeColor", value&gt; or &lt;"markerForeground", value&gt;</term> 258 <term>"markerEdgeColor",value or "markerForeground",value</term>
233 <listitem> 259 <listitem>
234 <para> 260 <para>
235 Specify the foreground color of the marker. 261 Color of the edge of markers. Colors can be specified as for
236 A color can be specified by a string representing a known color, 262 <varname>mcolors</varname>.
237 see <link linkend="color_list">color_list</link>. 263 This option supersedes <varname>mcolors</varname>.
238 A color can also be specified by a vector of 3 RGB values.
239 RGB values correspond to red, green and blue intensity between 0 and 1.
240 This option is superseded by argument <varname>mcolors</varname>.
241 </para> 264 </para>
242 </listitem> 265 </listitem>
243 </varlistentry> 266 </varlistentry>
244 <varlistentry> 267 <varlistentry>
245 <term>&lt;"markerFaceColor",value&gt; or &lt;"markerBackground",value&gt;</term> 268 <term>"markerFaceColor",value or "markerBackground",value</term>
246 <listitem> 269 <listitem>
247 <para> 270 <para>
248 Specify the background color of the marker. 271 Color filling the body of markers. Colors can be specified as for
249 A color can be specified by a string representing a known color 272 <varname>mcolors</varname>.
250 see <link linkend="color_list">color_list</link>. 273 This option supersedes <varname>mcolors</varname>.
251 A color can also be specified by a vector of 3 RGB values.
252 RGB values correspond to red, green and blue intensity between 0 and 1.
253 This option is superseded by argument <varname>mcolors</varname>.
254 </para> 274 </para>
255 </listitem> 275 </listitem>
256 </varlistentry> 276 </varlistentry>
257 <varlistentry> 277 <varlistentry>
258 <term>&lt;"linewidth",value&gt; or &lt;"thickness",value&gt;</term> 278 <term>"linewidth",value or "thickness",value</term>
259 <listitem> 279 <listitem>
260 <para> 280 <para>
261 Specify the thickness of the edge of the marker. 281 Specify the thickness of the edge for all markers.
262 The unit for the value is one point. 282 The unit for the value is one point.
263 </para> 283 </para>
264 </listitem> 284 </listitem>
265 </varlistentry> 285 </varlistentry>
266 <varlistentry> 286 <varlistentry>
267 <term>&lt;axes_handle&gt;</term> 287 <term>"datatips", k</term>
268 <listitem> 288 <listitem>
269 <para>This optional argument forces the scatter plot to appear inside the 289 <para>
270 selected axes given by <literal>axes_handle</literal> rather than inside the 290 Creates a datatip for all (X,Y) points whose indices are in the vector
271 current axes, see <link linkend="gca">gca</link>. 291 <varname>k</varname>.
272 </para> 292 </para>
273 </listitem>
274 </varlistentry>
275 <varlistentry>
276 <term>polyline</term>
277 <listitem>
278 <para> 293 <para>
279 Handle of the created polyline. 294 The <literal>datatip_display_mode</literal> is set to
295 <literal>"mouseover"</literal>. The datatip anchor is reduced to a point
296 set at the middle of the marker. The default datatips display the
297 (x,y) coordinates of the point. If <varname>msizes</varname> is a vector,
298 the size of each marker is also displayed.
280 </para> 299 </para>
281 </listitem> 300 </listitem>
282 </varlistentry> 301 </varlistentry>
@@ -298,181 +317,229 @@
298 For more details see the description of the arguments and the examples. 317 For more details see the description of the arguments and the examples.
299 </para> 318 </para>
300 <note> 319 <note>
301 To skip an argument, just replace it with <literal>[]</literal> like in 320 To skip an argument, just .. skip it, or replace it with <literal>[]</literal>, like in
302 <literal>scatter3d(x,y,z,[],mcolors)</literal>. 321 <literal>scatter3d(x,y, , mcolors)</literal> or <literal>scatter3d(x,y,[], mcolors)</literal>.
303 </note> 322 </note>
304 </refsection> 323 </refsection>
305 <refsection> 324 <refsection>
306 <title>Examples</title> 325 <title>Examples</title>
307 <para> 326 <para>
308 Create 2D scatter plot 327 With the default circle shape, and the same color for all points:
309 </para> 328 </para>
310 <programlisting role="example"><![CDATA[ 329 <programlisting role="example"><![CDATA[
311// x and y initialisation 330n = 130;
312x = linspace(0,2,200); 331x = rand(1,n);
313y = exp(-x).*cos(10*x) + 0.2*rand(1,length(x)); 332y = rand(1,n);
314// create 2D scatter plot 333
315scatter(x,y); 334clf
335subplot(2,3,1)
336scatter(x, y)
337title("scatter(x, y)", "fontsize",3)
338
339subplot(2,3,2)
340scatter(x, y, 100)
341title("scatter(x, y, 100)", "fontsize",3)
342
343subplot(2,3,3)
344mAreas = 10.^grand(1,n,"unf",1,2.4);
345scatter(x, y, mAreas)
346title("scatter(x, y, mAreas)", "fontsize",3)
347
348subplot(2,3,4)
349scatter(x, y, , "orange")
350tit = "scatter(x, y, ,""orange"")";
351title(tit, "fontsize",3)
352
353subplot(2,3,5)
354scatter(x, y, "fill")
355tit = "scatter(x, y, ""fill"")";
356title(tit, "fontsize",3)
357
358subplot(2,3,6)
359scatter(x, y, mAreas, "markerBackground", "yellow")
360tit = "scatter(x, y, mAreas,""markerBackground"", ""yellow"")";
361title(tit, "fontsize",1)
316 ]]></programlisting> 362 ]]></programlisting>
317 <scilab:image> 363 <scilab:image>
318 x = linspace(0,2,200) 364 n = 130;
319 y = exp(-x).*cos(10*x) + 0.2*rand(1,length(x)) 365 x = rand(1,n);
320 scatter(x,y) 366 y = rand(1,n);
367
368 clf
369 subplot(2,3,1)
370 scatter(x, y)
371 title("scatter(x, y)", "fontsize",3)
372
373 subplot(2,3,2)
374 scatter(x, y, 100)
375 title("scatter(x, y, 100)", "fontsize",3)
376
377 subplot(2,3,3)
378 mAreas = 10.^grand(1,n,"unf",1,2.4);
379 scatter(x, y, mAreas)
380 title("scatter(x, y, mAreas)", "fontsize",3)
381
382 subplot(2,3,4)
383 scatter(x, y, , "orange")
384 tit = "scatter(x, y, ,""orange"")";
385 title(tit, "fontsize",3)
386
387 subplot(2,3,5)
388 scatter(x, y, "fill")
389 tit = "scatter(x, y, ""fill"")";
390 title(tit, "fontsize",3)
391
392 subplot(2,3,6)
393 scatter(x, y, mAreas, "markerBackground", "yellow")
394 tit = "scatter(x, y, mAreas,""markerBackground"", ""yellow"")";
395 title(tit, "fontsize",1)
396
397 gcf().axes_size = [750 500];
321 </scilab:image> 398 </scilab:image>
322 <para> 399 <para>
323 Vary marker size 400 <emphasis role="bold">Option "smallOnTop"</emphasis>, avoiding intermasking effects:
324 </para> 401 </para>
325 <programlisting role="example"><![CDATA[ 402 <programlisting role="example"><![CDATA[
326// x and y initialisation 403n = 170;
327x = linspace(0,2,200); 404x = rand(1,n);
328y = exp(-x).*cos(10*x) + 0.2*rand(1,length(x)); 405y = rand(1,n);
329// specify different sizes 406mAreas = 10.^grand(1,n,"unf",1,2.8);
330s = linspace(1,30,length(x)); 407
331// create 2D scatter plot 408clf
332scatter(x, y, s); 409subplot(1,2,1)
410scatter(x, y, mAreas, "wheat", "fill", "markerEdgeColor", "red")
411title("Raw display", "fontsize",3)
412
413subplot(1,2,2)
414scatter(x, y, mAreas, "wheat", "fill", "smallOnTop", "markerEdgeColor", "red")
415title("""SmallOnTop"" option", "fontsize",3)
333 ]]></programlisting> 416 ]]></programlisting>
334 <scilab:image> 417 <scilab:image>
335 x = linspace(0,2,200) 418 n = 170;
336 y = exp(-x).*cos(10*x) + 0.2*rand(1,length(x)) 419 x = rand(1,n);
337 s = linspace(1,30,length(x)) 420 y = rand(1,n);
338 scatter(x,y,s) 421 mAreas = 10.^grand(1,n,"unf",1,2.8);
422
423 clf
424 subplot(1,2,1)
425 scatter(x, y, mAreas, "wheat", "fill", "markerEdgeColor", "red")
426 title("Raw display", "fontsize",3)
427
428 subplot(1,2,2)
429 scatter(x, y, mAreas, "wheat", "fill", "SmallOnTop", "markerEdgeColor", "red")
430 title("""SmallOnTop"" option", "fontsize",3)
431
432 gcf().axes_size = [600 270];
339 </scilab:image> 433 </scilab:image>
434
340 <para> 435 <para>
341 Vary marker size and color 436 Vary marker size and color
342 </para> 437 </para>
343 <programlisting role="example"><![CDATA[ 438 <programlisting role="example"><![CDATA[
344// x and y initialisation
345x = linspace(0, 2, 200);
346y = exp(-x).*cos(10*x) + 0.2*rand(1,length(x));
347// specify different sizes
348s = linspace(1, 30, length(x));
349// set color map
350gcf().color_map = coolcolormap(64);
351// colors according to x values
352c = x;
353// create 2D scatter plot
354scatter(x,y,s,c);
355 ]]></programlisting>
356 <scilab:image>
357 x = linspace(0,2,200)
358 y = exp(-x).*cos(10*x) + 0.2*rand(1,length(x))
359 s = linspace(1,30,length(x))
360 gcf().color_map = coolcolormap(64)
361 c = x
362 scatter(x,y,s,c)
363 </scilab:image>
364 <para>
365 Fill the markers
366 </para>
367 <programlisting role="example"><![CDATA[
368// x and y initialisation
369x = linspace(0, 2, 200); 439x = linspace(0, 2, 200);
370y = exp(-x).*cos(10*x) + 0.2*rand(1,length(x)); 440y = exp(-x).*cos(10*x) + 0.2*rand(1,length(x));
371// specify different sizes 441
372s = linspace(1, 30, length(x)); 442s = linspace(1, 30, length(x)); // specify different sizes
373// set color map 443gcf().color_map = coolcolormap(64); // set color map
374gcf().color_map = coolcolormap(64); 444c = x; // colors according to x values
375// colors according to y values 445subplot(1,2,1)
376c = y; 446scatter(x, y, s, c); // create 2D scatter plot
377// create 2D scatter plot 447
448// Fill the markers
449subplot(1,2,2)
378scatter(x, y, s, c, "fill"); 450scatter(x, y, s, c, "fill");
379 ]]></programlisting> 451 ]]></programlisting>
380 <scilab:image> 452 <scilab:image>
381 x = linspace(0,2,200) 453 x = linspace(0, 2, 200);
382 y = exp(-x).*cos(10*x) + 0.2*rand(1,length(x)) 454 y = exp(-x).*cos(10*x) + 0.2*rand(1,length(x));
383 s = linspace(1,30,length(x)) 455
384 gcf().color_map = coolcolormap(64); 456 s = linspace(1, 30, length(x)); // specify different sizes
385 c = y 457 gcf().color_map = coolcolormap(64); // set color map
386 scatter(x,y,s,c,"fill") 458 c = x; // colors according to x values
459 subplot(1,2,1)
460 scatter(x, y, s, c); // create 2D scatter plot
461
462 // Fill the markers
463 subplot(1,2,2)
464 scatter(x, y, s, c, "fill");
465 gcf().axes_size = [700 350];
387 </scilab:image> 466 </scilab:image>
388 <para> 467 <para>
389 Specify marker symbol 468 Specify the marker
390 </para> 469 </para>
391 <programlisting role="example"><![CDATA[ 470 <programlisting role="example"><![CDATA[
392// x and y initialisation
393x = rand(1, 200); 471x = rand(1, 200);
394y = rand(1, 200); 472y = rand(1, 200);
395// create 2D scatter plot 473
474subplot(2,2,1)
396scatter(x, y, "d"); 475scatter(x, y, "d");
397 ]]></programlisting> 476
398 <scilab:image> 477subplot(2,2,2)
399 x = rand(1,200)
400 y = rand(1,200)
401 scatter(x,y,"d")
402 </scilab:image>
403 <para>
404 Change marker color and line width
405 </para>
406 <programlisting role="example"><![CDATA[
407// x and y initialisation
408x = rand(1, 200);
409y = rand(1, 200);
410// create 2D scatter plot
411scatter(x, y, "markerEdgeColor",[0 .4 .4],... 478scatter(x, y, "markerEdgeColor",[0 .4 .4],...
412 "markerFaceColor",[0 .8 .8],... 479 "markerFaceColor","magenta",...
413 "linewidth",1.5); 480 "linewidth",1.5);
481
482subplot(2,2,3)
483scatter(x, y, 60, "red", "+"); // Marker's symbol
484
485subplot(2,2,4)
486scatter(x, y, 60, "green", 14); // Marker's index
414 ]]></programlisting> 487 ]]></programlisting>
415 <scilab:image> 488 <scilab:image>
416 x = rand(1,200) 489 x = rand(1, 200);
417 y = rand(1,200) 490 y = rand(1, 200);
418 scatter(x,y,"markerEdgeColor",[0 .4 .4],... 491
419 "markerFaceColor",[0 .8 .8],... 492 subplot(2,2,1)
420 "linewidth",1.5) 493 scatter(x, y, "d");
494
495 subplot(2,2,2)
496 scatter(x, y, "markerEdgeColor",[0 .4 .4],...
497 "markerFaceColor","magenta",...
498 "linewidth",1.5);
499
500 subplot(2,2,3)
501 scatter(x, y, 60, "red", "+"); // Marker's symbol
502
503 subplot(2,2,4)
504 scatter(x, y, 60, "green", 14); // Marker's index
505
506 gcf().axes_size = [600 500];
421 </scilab:image> 507 </scilab:image>
422 <para> 508 <para>
423 Specify subplot for scatter plot 509 Post-processing a scatter plot:
424 </para> 510 </para>
425 <programlisting role="example"><![CDATA[ 511 <programlisting role="example"><![CDATA[
426// x and y initialisation 512n = 150;
427x = linspace(0, 2, 100); 513x = rand(1,n);
428y = exp(-x).*cos(10*x) + 0.2*rand(1,length(x)); 514y = rand(1,n);
429// create 2D scatter subplot 515mAreas = 10.^grand(1,n,"unf",1,2.8);
430subplot(2, 1, 1) 516
431scatter(gca(), x, y); 517clf
432// create 2D scatter subplot 518p = scatter(x, y, mAreas, "yel", "fill", "markerEdgeColor", "red")
433subplot(2, 1, 2) 519
434scatter(gca(), x, y, "fill", "s"); 520// Post-processing
435 ]]></programlisting> 521k = mAreas<median(mAreas)*2;
436 <scilab:image> 522bg = ones(1,n) * p.mark_background;
437 x = linspace(0,2,100) 523bg(k) = color("orange");
438 y = exp(-x).*cos(10*x) + 0.2*rand(1,length(x)) 524p.mark_background = bg;
439 subplot(2,1,1) 525 ]]></programlisting>
440 scatter(gca(),x,y) 526 <scilab:image><![CDATA[
441 subplot(2,1,2) 527 n = 150;
442 scatter(gca(),x,y,"fill","s") 528 x = rand(1,n);
443 </scilab:image> 529 y = rand(1,n);
444 <para> 530 mAreas = 10.^grand(1,n,"unf",1,2.8);
445 Modify scatter plot after creation 531
446 </para> 532 clf
447 <programlisting role="example"><![CDATA[ 533 p = scatter(x, y, mAreas, "yel", "fill", "markerEdgeColor", "red")
448// x and y initialisation 534
449t = linspace(0,1,200); 535 // Post-processing
450x = t .* cos(10*%pi*t); 536 k = mAreas<median(mAreas)*2;
451y = t .* sin(10*%pi*t); 537 bg = ones(1,n) * p.mark_background;
452// create 2D scatter plot 538 bg(k) = color("orange");
453p = scatter(x, y); 539 p.mark_background = bg;
454 ]]></programlisting> 540
455 <scilab:image> 541 gcf().axes_size = [450 300];
456 t = linspace(0,25,200) 542 ]]></scilab:image>
457 x = t.*cos(t)
458 y = t.*sin(t)
459 p = scatter(x,y,t)
460 </scilab:image>
461 <programlisting role="example"><![CDATA[
462// modify polyline
463p.thickness = 0.5;
464p.mark_foreground = color("darkblue");
465p.mark_background = color("darkcyan");
466 ]]></programlisting>
467 <scilab:image>
468 t = linspace(0,25,200)
469 x = t.*cos(t)
470 y = t.*sin(t)
471 p = scatter(x,y,t)
472 p.thickness = 0.5
473 p.mark_foreground = color("darkblue")
474 p.mark_background = color("darkcyan")
475 </scilab:image>
476 </refsection> 543 </refsection>
477 <refsection role="see also"> 544 <refsection role="see also">
478 <title>See also</title> 545 <title>See also</title>
@@ -503,7 +570,22 @@ p.mark_background = color("darkcyan");
503 <revision> 570 <revision>
504 <revnumber>6.0.0</revnumber> 571 <revnumber>6.0.0</revnumber>
505 <revremark> 572 <revremark>
506 Function <function>scatter</function> introduced. 573 Function scatter() introduced.
574 </revremark>
575 </revision>
576 <revision>
577 <revnumber>6.1.0</revnumber>
578 <revremark>
579 <itemizedlist>
580 <listitem>
581 Colors can be specified as well with their "#RRGGBB" hexadecimal
582 standard code, or their index in the color map.
583 </listitem>
584 <listitem>
585 Options <emphasis>SmallOnTop</emphasis> and
586 <emphasis>"datatips"</emphasis> added.
587 </listitem>
588 </itemizedlist>
507 </revremark> 589 </revremark>
508 </revision> 590 </revision>
509 </revhistory> 591 </revhistory>
diff --git a/scilab/modules/graphics/help/en_US/2d_plot/semilogx.xml b/scilab/modules/graphics/help/en_US/2d_plot/semilogx.xml
new file mode 100644
index 0000000..e22470b
--- /dev/null
+++ b/scilab/modules/graphics/help/en_US/2d_plot/semilogx.xml
@@ -0,0 +1,175 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) INRIA - Fabrice Leray
5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
6 * Copyright (C) 2018 - 2019 - Samuel GOUGEON
7 * Copyright (C) 2020 - Stéphane MOTTELET
8 *
9 * This file is hereby licensed under the terms of the GNU GPL v2.0,
10 * pursuant to article 5.3.4 of the CeCILL v.2.1.
11 * This file was originally licensed under the terms of the CeCILL v2.1,
12 * and continues to be available under such terms.
13 * For more information, see the COPYING file which you should have received
14 * along with this program.
15 *
16 -->
17<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
18 xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
19 xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
20 xml:lang="en" xml:id="semilogx">
21 <refnamediv>
22 <refname>semilogx</refname>
23 <refpurpose>2D semilogarithmic plot</refpurpose>
24 </refnamediv>
25 <refsynopsisdiv>
26 <title>Syntax</title>
27 <synopsis>
28 semilogx // demo
29 semilogx(y)
30 semilogx(x, y)
31 semilogx(x, fun)
32 semilogx(x, list(fun, param))
33 semilogx(.., LineSpec)
34 semilogx(.., LineSpec, GlobalProperty)
35 semilogx(x1, y1, LineSpec1, x2,y2,LineSpec2,...xN, yN, LineSpecN, GlobalProperty1,.. GlobalPropertyM)
36 semilogx(x1,fun1,LineSpec1, x2,y2,LineSpec2,...xN,funN,LineSpecN, GlobalProperty1, ..GlobalPropertyM)
37 semilogx(axes_handle,...)
38 </synopsis>
39 </refsynopsisdiv>
40 <refsection>
41 <title>Arguments</title>
42 <variablelist>
43 <varlistentry>
44 <term>x</term>
45 <listitem>
46 <para>
47 vector or matrix of strictly positive real numbers or integers. If omitted, it is assumed
48 to be the vector <literal>1:n</literal> where <literal>n</literal> is the
49 number of curve points given by the <literal>y</literal> parameter.
50 </para>
51 </listitem>
52 </varlistentry>
53 <varlistentry>
54 <term>y</term>
55 <listitem>
56 <para>
57 vector or matrix of real numbers or of integers.
58 </para>
59 </listitem>
60 </varlistentry>
61 <varlistentry>
62 <term>fun, fun1, ..</term>
63 <listitem>
64 <para>
65 handle of a function, as in <literal>semilogx(x, sin)</literal>.
66 </para>
67 <para>
68 If the function to plot needs some parameters as input arguments, the
69 function and its parameters can be specified through a list, as in
70 <literal>semilogx(x, list(delip, -0.4))</literal>
71 </para>
72 </listitem>
73 </varlistentry>
74 <varlistentry>
75 <term>LineSpec</term>
76 <listitem>
77 <para>This optional argument must be a string that will be used as a
78 shortcut to specify a way of drawing a line. We can have one
79 <literal>LineSpec</literal> per <literal>y</literal> or <literal>{x,y}</literal>
80 previously entered. <literal>LineSpec</literal> options deals with
81 LineStyle, Marker and Color specifiers (see <link linkend="LineSpec">LineSpec</link>).
82 Those specifiers determine the line style, mark style and color of
83 the plotted lines.
84 </para>
85 </listitem>
86 </varlistentry>
87 <varlistentry>
88 <term>GlobalProperty</term>
89 <listitem>
90 <para>This optional argument represents a sequence of couple
91 statements <literal>{PropertyName,PropertyValue}</literal> that defines
92 global objects' properties applied to all the curves created by this
93 plot. For a complete view of the available properties (see
94 <link linkend="GlobalProperty">GlobalProperty</link>).
95 </para>
96 </listitem>
97 </varlistentry>
98 <varlistentry>
99 <term>axes_handle</term>
100 <listitem>
101 <para>This optional argument forces the plot to appear inside the
102 selected axes given by <literal>axes_handle</literal> rather than the
103 current axes (see <link linkend="gca">gca</link>).
104 </para>
105 </listitem>
106 </varlistentry>
107 </variablelist>
108 </refsection>
109 <refsection>
110 <title>Description</title>
111 <para><literal>semilogx</literal> plots data using a base 10 logarithmic scale for the x-axis and a normal (linear) scale for the y-axis. The possible syntaxes and arguments are the same as the <link linkend="plot">plot</link> function besides the condition that the abscisae values in <term>x</term> argument be strictly positive.
112 </para>
113 <para>If the current axes is not empty and the the x-axis has a negative lower bound then its scale will remain linear after the plot.
114 </para>
115 <para>
116 Enter the command <literal>semilogx</literal> to see a demo.
117 </para>
118 </refsection>
119 <refsection>
120 <title>Examples</title>
121 <programlisting role="example"><![CDATA[
122 w=logspace(-2,2,1000);
123 s=%i*w;
124 g=1../(s.^2+s+1);
125 clf("reset")
126
127 semilogx(w,abs(g));
128
129 title("$\LARGE \left|1/(s^2+s+1)\right|\mbox{ for }s=i\omega$")
130 xlabel("$\LARGE \omega$")
131 ]]></programlisting>
132 <scilab:image>
133 w=logspace(-2,2,1000);
134 s=%i*w;
135 g=1../(s.^2+s+1);
136 clf("reset")
137
138 semilogx(w,abs(g));
139
140 title("$\LARGE \left|1/(s^2+s+1)\right|\mbox{ for }s=i\omega$")
141 xlabel("$\LARGE \omega$")
142 </scilab:image>
143 </refsection>
144 <refsection role="see also">
145 <title>See also</title>
146 <simplelist type="inline">
147 <member>
148 <link linkend="plot">plot</link>
149 </member>
150 <member>
151 <link linkend="semilogy">semilogy</link>
152 </member>
153 <member>
154 <link linkend="loglog">loglog</link>
155 </member>
156 <member>
157 <link linkend="LineSpec">LineSpec</link>
158 </member>
159 <member>
160 <link linkend="GlobalProperty">GlobalProperty</link>
161 </member>
162 </simplelist>
163 </refsection>
164 <refsection role="history">
165 <title>History</title>
166 <revhistory>
167 <revision>
168 <revnumber>6.1.1</revnumber>
169 <revdescription>
170 Function semilogx added.
171 </revdescription>
172 </revision>
173 </revhistory>
174 </refsection>
175</refentry>
diff --git a/scilab/modules/graphics/help/en_US/2d_plot/semilogy.xml b/scilab/modules/graphics/help/en_US/2d_plot/semilogy.xml
new file mode 100644
index 0000000..8a75808
--- /dev/null
+++ b/scilab/modules/graphics/help/en_US/2d_plot/semilogy.xml
@@ -0,0 +1,175 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) INRIA - Fabrice Leray
5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
6 * Copyright (C) 2018 - 2019 - Samuel GOUGEON
7 * Copyright (C) 2020 - Stéphane MOTTELET
8 *
9 * This file is hereby licensed under the terms of the GNU GPL v2.0,
10 * pursuant to article 5.3.4 of the CeCILL v.2.1.
11 * This file was originally licensed under the terms of the CeCILL v2.1,
12 * and continues to be available under such terms.
13 * For more information, see the COPYING file which you should have received
14 * along with this program.
15 *
16 -->
17<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
18 xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
19 xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
20 xml:lang="en" xml:id="semilogy">
21 <refnamediv>
22 <refname>semilogy</refname>
23 <refpurpose>2D semilogarithmic plot</refpurpose>
24 </refnamediv>
25 <refsynopsisdiv>
26 <title>Syntax</title>
27 <synopsis>
28 semilogy // demo
29 semilogy(y)
30 semilogy(x, y)
31 semilogy(x, fun)
32 semilogy(x, list(fun, param))
33 semilogy(.., LineSpec)
34 semilogy(.., LineSpec, GlobalProperty)
35 semilogy(x1, y1, LineSpec1, x2,y2,LineSpec2,...xN, yN, LineSpecN, GlobalProperty1,.. GlobalPropertyM)
36 semilogy(x1,fun1,LineSpec1, x2,y2,LineSpec2,...xN,funN,LineSpecN, GlobalProperty1, ..GlobalPropertyM)
37 semilogy(axes_handle,...)
38 </synopsis>
39 </refsynopsisdiv>
40 <refsection>
41 <title>Arguments</title>
42 <variablelist>
43 <varlistentry>
44 <term>x</term>
45 <listitem>
46 <para>
47 vector or matrix of real numbers or integers. If omitted, it is assumed
48 to be the vector <literal>1:n</literal> where <literal>n</literal> is the
49 number of curve points given by the <literal>y</literal> parameter.
50 </para>
51 </listitem>
52 </varlistentry>
53 <varlistentry>
54 <term>y</term>
55 <listitem>
56 <para>
57 vector or matrix of strictly positive real numbers or integers.
58 </para>
59 </listitem>
60 </varlistentry>
61 <varlistentry>
62 <term>fun, fun1, ..</term>
63 <listitem>
64 <para>
65 handle of a function, as in <literal>semilogy(x, gamma)</literal>.
66 </para>
67 <para>
68 If the function to plot needs some parameters as input arguments, the
69 function and its parameters can be specified through a list, as in
70 <literal>semilogy(x, list(delip, -0.4))</literal>
71 </para>
72 </listitem>
73 </varlistentry>
74 <varlistentry>
75 <term>LineSpec</term>
76 <listitem>
77 <para>This optional argument must be a string that will be used as a
78 shortcut to specify a way of drawing a line. We can have one
79 <literal>LineSpec</literal> per <literal>y</literal> or <literal>{x,y}</literal>
80 previously entered. <literal>LineSpec</literal> options deals with
81 LineStyle, Marker and Color specifiers (see <link linkend="LineSpec">LineSpec</link>).
82 Those specifiers determine the line style, mark style and color of
83 the plotted lines.
84 </para>
85 </listitem>
86 </varlistentry>
87 <varlistentry>
88 <term>GlobalProperty</term>
89 <listitem>
90 <para>This optional argument represents a sequence of couple
91 statements <literal>{PropertyName,PropertyValue}</literal> that defines
92 global objects' properties applied to all the curves created by this
93 plot. For a complete view of the available properties (see
94 <link linkend="GlobalProperty">GlobalProperty</link>).
95 </para>
96 </listitem>
97 </varlistentry>
98 <varlistentry>
99 <term>axes_handle</term>
100 <listitem>
101 <para>This optional argument forces the plot to appear inside the
102 selected axes given by <literal>axes_handle</literal> rather than the
103 current axes (see <link linkend="gca">gca</link>).
104 </para>
105 </listitem>
106 </varlistentry>
107 </variablelist>
108 </refsection>
109 <refsection>
110 <title>Description</title>
111 <para><literal>semilogy</literal> plots data using a base 10 logarithmic scale for the y-axis and a normal (linear) scale for the x-axis. The possible syntaxes and arguments are the same as the <link linkend="plot">plot</link> function besides the condition that the ordinate values in <term>y</term> argument be strictly positive.
112 </para>
113 <para>If the current axes is not empty and the y-axis has a negative lower bound then its scale will remain linear after the plot.
114 </para>
115 <para>
116 Enter the command <literal>loglog</literal> to see a demo.
117 </para>
118 </refsection>
119 <refsection>
120 <title>Examples</title>
121 <programlisting role="example"><![CDATA[
122 w=logspace(-2,2,1000);
123 s=%i*w;
124 g=1../(s.^2+s+1);
125 clf("reset")
126
127 semilogy(w,abs(g));
128
129 title("$\LARGE \left|1/(s^2+s+1)\right|\mbox{ for }s=i\omega$")
130 xlabel("$\LARGE \omega$")
131 ]]></programlisting>
132 <scilab:image>
133 w=logspace(-2,2,1000);
134 s=%i*w;
135 g=1../(s.^2+s+1);
136 clf("reset")
137
138 semilogy(w,abs(g));
139
140 title("$\LARGE \left|1/(s^2+s+1)\right|\mbox{ for }s=i\omega$")
141 xlabel("$\LARGE \omega$")
142 </scilab:image>
143 </refsection>
144 <refsection role="see also">
145 <title>See also</title>
146 <simplelist type="inline">
147 <member>
148 <link linkend="plot">plot</link>
149 </member>
150 <member>
151 <link linkend="semilogx">semilogx</link>
152 </member>
153 <member>
154 <link linkend="loglog">loglog</link>
155 </member>
156 <member>
157 <link linkend="LineSpec">LineSpec</link>
158 </member>
159 <member>
160 <link linkend="GlobalProperty">GlobalProperty</link>
161 </member>
162 </simplelist>
163 </refsection>
164 <refsection role="history">
165 <title>History</title>
166 <revhistory>
167 <revision>
168 <revnumber>6.1.1</revnumber>
169 <revdescription>
170 Function semilogy added.
171 </revdescription>
172 </revision>
173 </revhistory>
174 </refsection>
175</refentry>
diff --git a/scilab/modules/graphics/help/en_US/3d_plot/scatter3d.xml b/scilab/modules/graphics/help/en_US/3d_plot/scatter3d.xml
index 44bc01c..77d1ecd 100644
--- a/scilab/modules/graphics/help/en_US/3d_plot/scatter3d.xml
+++ b/scilab/modules/graphics/help/en_US/3d_plot/scatter3d.xml
@@ -2,8 +2,8 @@
2<!-- 2<!--
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) Scilab Enterprises - 2015 - 2012 - Juergen Koch 4 * Copyright (C) Scilab Enterprises - 2015 - 2012 - Juergen Koch
5 *
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises 5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
6 * Copyright (C) 2020 - Samuel GOUGEON
7 * 7 *
8 * This file is hereby licensed under the terms of the GNU GPL v2.0, 8 * This file is hereby licensed under the terms of the GNU GPL v2.0,
9 * pursuant to article 5.3.4 of the CeCILL v.2.1. 9 * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -23,13 +23,20 @@
23 </refnamediv> 23 </refnamediv>
24 <refnamediv xml:id="scatter3"> 24 <refnamediv xml:id="scatter3">
25 <refname>scatter3</refname> 25 <refname>scatter3</refname>
26 <refpurpose>3D scatter plot (obsolete)</refpurpose> 26 <refpurpose>3D scatter plot <emphasis role="bold">(obsolete)</emphasis></refpurpose>
27 </refnamediv> 27 </refnamediv>
28 <refsynopsisdiv> 28 <refsynopsisdiv>
29 <title>Syntax</title> 29 <title>Syntax</title>
30 <synopsis> 30 <synopsis>
31 polyline = scatter3d(x, y, z, msizes, mcolors, "fill", marker, &lt;marker_property,value&gt;) 31 scatter3d() // Example
32 polyline = scatter3d(axes_handle,...) 32 scatter3d(x, y, z)
33 scatter3d(x, y, z, msizes)
34 scatter3d(x, y, z, msizes, mcolors)
35 scatter3d(.., "fill")
36 scatter3d(.., "fill", marker)
37 scatter3d(..., &lt;marker_property, value>)
38 scatter3d(axes, ..)
39 polyline = scatter3d(..)
33 </synopsis> 40 </synopsis>
34 </refsynopsisdiv> 41 </refsynopsisdiv>
35 <refsection> 42 <refsection>
@@ -46,16 +53,28 @@
46 </listitem> 53 </listitem>
47 </varlistentry> 54 </varlistentry>
48 <varlistentry> 55 <varlistentry>
56 <term>axes</term>
57 <listitem>
58 Handle of the graphical axes in which the scatter plot must be drawn.
59 By default, the current axes is targeted.
60 <para/>
61 </listitem>
62 </varlistentry>
63 <varlistentry>
64 <term>polyline</term>
65 <listitem>
66 Handle of the created polyline.
67 <para/>
68 </listitem>
69 </varlistentry>
70 <varlistentry>
49 <term>msizes</term> 71 <term>msizes</term>
50 <listitem> 72 <listitem>
51 <para> 73 <para>
52 Specifying the sizes of the markers. 74 Sizes of the markers, as of the area of the circle surrounding the marker,
53 To plot each marker with equal size, specify <varname>msizes</varname> as a scalar. 75 in point-square. Default value = 36. If it is scalar,
54 To plot each marker with a different size, specify <varname>msizes</varname> 76 the same size is used for all markers. Otherwise <varname>msizes</varname>
55 as a vector with n components. 77 and <varname>x</varname> must have the same number of elements.
56 The units for <varname>msizes</varname> is points squared, with a default
57 value of 36 points squared.
58 The size equals the area of the circle surrounding the marker.
59 </para> 78 </para>
60 </listitem> 79 </listitem>
61 </varlistentry> 80 </varlistentry>
@@ -63,18 +82,35 @@
63 <term>mcolors</term> 82 <term>mcolors</term>
64 <listitem> 83 <listitem>
65 <para> 84 <para>
66 Specifying the colors of the markers. 85 Colors of markers. If it is scalar, the same color is used for all markers.
67 To plot each marker with the same color, specify <varname>mcolors</varname> 86 Otherwise, <varname>mcolors</varname> and <varname>x</varname> must have
68 as a string representing a known color: see <link linkend="color_list">color_list</link>. 87 the same number of elements.
69 A color can also be specified by a vector of 3 RGB values. 88 </para>
70 RGB values correspond to red, green and blue intensity between 0 and 1. 89 <para>
71 To plot each marker with a different color, specify <varname>mcolors</varname> 90 The same color is used for filling the body and drawing the edge of markers.
72 as a vector with n components. 91 </para>
92 <para>
73 The values of <varname>mcolors</varname> are linearly mapped to the colors 93 The values of <varname>mcolors</varname> are linearly mapped to the colors
74 in the current colormap. 94 in the current colormap.
75 Colors can also by specified by a matrix of RGB values or a vector of 95 </para>
76 strings representing known colors. 96 <para>
77 A matrix of RGB values has 3 columns and n rows. 97 A color can be specified by one of the following:
98 <itemizedlist>
99 <listitem>
100 Its name, among the predefined names colors
101 (see the <link linkend="color_list">color_list</link>).
102 </listitem>
103 <listitem>
104 Its standard hexadecimal RGB code as a string, like "#A532FB".
105 </listitem>
106 <listitem>
107 A matrix of RGB values with 3 columns and n rows, with Red Green and
108 Blue intensities in [0,1].
109 </listitem>
110 <listitem>
111 Its index in the current color map
112 </listitem>
113 </itemizedlist>
78 The default color is "blue". 114 The default color is "blue".
79 </para> 115 </para>
80 </listitem> 116 </listitem>
@@ -83,10 +119,9 @@
83 <term>"fill"</term> 119 <term>"fill"</term>
84 <listitem> 120 <listitem>
85 <para> 121 <para>
86 This string indicates that the markers are filled with some colors. 122 By default, only the edge of markers is drawn, unless this keyword or the
87 By default the filling colors of markers are the same as their shape ones. 123 <varname>"markerFaceColor"</varname> or
88 However, both colors can be set independently by using the properties 124 <varname>"markerBackgroundColor"</varname> properties are set.
89 <literal>"markerFaceColor"</literal> or <literal>"markerBackgroundColor"</literal>.
90 </para> 125 </para>
91 </listitem> 126 </listitem>
92 </varlistentry> 127 </varlistentry>
@@ -94,9 +129,8 @@
94 <term>marker</term> 129 <term>marker</term>
95 <listitem> 130 <listitem>
96 <para> 131 <para>
97 Select the type of the marker. The same marker shape is used for all 132 Selects the shape of the markers. The same shape is used for all
98 specified points. 133 specified points. The figure below shows the 15 different marker shapes.
99 The figure below shows the 15 different marker types.
100 </para> 134 </para>
101 <para> 135 <para>
102 <inlinemediaobject> 136 <inlinemediaobject>
@@ -106,192 +140,144 @@
106 </inlinemediaobject> 140 </inlinemediaobject>
107 </para> 141 </para>
108 <para> 142 <para>
109 Marker types are specified by strings: see the table below. 143 Each marker shape is specified either by its index (list above) or by
144 its string symbol (table below).
110 </para> 145 </para>
111 <para> 146 <para>
112 <informaltable border="1"> 147 <informaltable border="1">
113 <tr> 148 <tr><td>Index</td>
114 <td> 149 <td>String</td>
115 String 150 <td>Marker type</td>
116 </td>
117 <td>
118 Marker type
119 </td>
120 </tr> 151 </tr>
121 <tr> 152 <tr>
122 <td> 153 <td>0</td>
123 <literal>"."</literal> 154 <td><literal>"."</literal></td>
124 </td>
125 <td>Point</td> 155 <td>Point</td>
126 </tr> 156 </tr>
127 <tr> 157 <tr>
128 <td> 158 <td>1</td>
129 <literal>"+"</literal> 159 <td><literal>"+"</literal></td>
130 </td>
131 <td>Plus sign</td> 160 <td>Plus sign</td>
132 </tr> 161 </tr>
133 <tr> 162 <tr>
134 <td> 163 <td>2</td>
135 <literal>"x"</literal> 164 <td><literal>"x"</literal></td>
136 </td>
137 <td>Cross</td> 165 <td>Cross</td>
138 </tr> 166 </tr>
139 <tr> 167 <tr>
140 <td> 168 <td>3</td>
141 <literal>"circle plus"</literal> 169 <td><literal>"circle plus"</literal></td>
142 </td>
143 <td>Circle with plus</td> 170 <td>Circle with plus</td>
144 </tr> 171 </tr>
145 <tr> 172 <tr>
146 <td> 173 <td>4</td>
147 <literal>"filled diamond"</literal> 174 <td><literal>"filled diamond"</literal></td>
148 </td>
149 <td>Filled diamond</td> 175 <td>Filled diamond</td>
150 </tr> 176 </tr>
151 <tr> 177 <tr>
152 <td> 178 <td>5</td>
153 <literal>"d"</literal> or 179 <td><literal>"d"</literal> or <literal>"diamond"</literal></td>
154 <literal>"diamond"</literal>
155 </td>
156 <td>Diamond</td> 180 <td>Diamond</td>
157 </tr> 181 </tr>
158 <tr> 182 <tr>
159 <td> 183 <td>6</td>
160 <literal>"^"</literal> 184 <td><literal>"^"</literal></td>
161 </td>
162 <td>Upward-pointing triangle</td> 185 <td>Upward-pointing triangle</td>
163 </tr> 186 </tr>
164 <tr> 187 <tr>
165 <td> 188 <td>7</td>
166 <literal>"v"</literal> 189 <td><literal>"v"</literal></td>
167 </td>
168 <td>Downward-pointing triangle</td> 190 <td>Downward-pointing triangle</td>
169 </tr> 191 </tr>
170 <tr> 192 <tr>
171 <td> 193 <td>8</td>
172 <literal>"diamond plus"</literal> 194 <td><literal>"diamond plus"</literal></td>
173 </td>
174 <td>Diamond with plus</td> 195 <td>Diamond with plus</td>
175 </tr> 196 </tr>
176 <tr> 197 <tr>
177 <td> 198 <td>9</td>
178 <literal>"o"</literal> 199 <td><literal>"o"</literal></td>
179 </td>
180 <td>Circle (default)</td> 200 <td>Circle (default)</td>
181 </tr> 201 </tr>
182 <tr> 202 <tr>
183 <td> 203 <td>10</td>
184 <literal>"*"</literal> 204 <td><literal>"*"</literal></td>
185 </td>
186 <td>Asterisk</td> 205 <td>Asterisk</td>
187 </tr> 206 </tr>
188 <tr> 207 <tr>
189 <td> 208 <td>11</td>
190 <literal>"s"</literal> or 209 <td><literal>"s"</literal> or <literal>"square"</literal></td>
191 <literal>"square"</literal>
192 </td>
193 <td>Square</td> 210 <td>Square</td>
194 </tr> 211 </tr>
195 <tr> 212 <tr>
196 <td> 213 <td>12</td>
197 <literal>"&gt;"</literal> 214 <td><literal>">"</literal></td>
198 </td>
199 <td>Right-pointing triangle</td> 215 <td>Right-pointing triangle</td>
200 </tr> 216 </tr>
201 <tr> 217 <tr>
202 <td> 218 <td>13</td>
203 <literal>"&lt;"</literal> 219 <td><literal>"&lt;"</literal></td>
204 </td>
205 <td>Left-pointing triangle</td> 220 <td>Left-pointing triangle</td>
206 </tr> 221 </tr>
207 <tr> 222 <tr>
208 <td> 223 <td>14</td>
209 <literal>"pentagram"</literal> or 224 <td><literal>"pentagram"</literal> or <literal>"p"</literal></td>
210 <literal>"p"</literal>
211 </td>
212 <td>Five-pointed star</td> 225 <td>Five-pointed star</td>
213 </tr> 226 </tr>
214 </informaltable> 227 </informaltable>
215 </para> 228 </para>
216 </listitem> 229 </listitem>
217 </varlistentry> 230 </varlistentry>
231 </variablelist>
232 <refsect3>
233 <title>Property &lt;Name, Value> pairs</title>
234 <para>
235 A series of property value pairs can be used to specify type, color and
236 line width of the markers.
237 </para>
238 </refsect3>
239 <variablelist>
218 <varlistentry> 240 <varlistentry>
219 <term>&lt;marker_property, value&gt;</term> 241 <term>"marker", value or "markerStyle", value</term>
220 <listitem>
221 <para>
222 A sequence of property value pairs can be used to specify type, color and
223 line width of the markers.
224 </para>
225 </listitem>
226 </varlistentry>
227 <varlistentry>
228 <term>&lt;"marker", value&gt; or &lt;"markerStyle", value&gt;</term>
229 <listitem> 242 <listitem>
230 <para> 243 <para>
231 Specify the type of the marker, see the table above. 244 Shape of the marker (index or string keyword). See the table above.
232 </para> 245 </para>
233 </listitem> 246 </listitem>
234 </varlistentry> 247 </varlistentry>
235 <varlistentry> 248 <varlistentry>
236 <term>&lt;"markerEdgeColor", value&gt; or &lt;"markerForeground", value&gt;</term> 249 <term>"markerEdgeColor", value or "markerForeground", value</term>
237 <listitem> 250 <listitem>
238 <para> 251 <para>
239 Specify the foreground color of the marker. 252 Color of the edge of markers. Colors can be specified as for
240 A color can be specified by a string representing a known color: 253 <varname>mcolors</varname>.
241 see <link linkend="color_list">color_list</link>. 254 This option supersedes <varname>mcolors</varname>.
242 A color can also be specified by a vector of 3 RGB values.
243 RGB values correspond to red, green and blue intensity between 0 and 1.
244 This option is superseded by the <varname>mcolors</varname> argument.
245 </para> 255 </para>
246 </listitem> 256 </listitem>
247 </varlistentry> 257 </varlistentry>
248 <varlistentry> 258 <varlistentry>
249 <term>&lt;"markerFaceColor", value&gt; or &lt;"markerBackground", value&gt;</term> 259 <term>"markerFaceColor",value or "markerBackground",value</term>
250 <listitem> 260 <listitem>
251 <para> 261 <para>
252 Specify the background color of the marker. 262 Color filling the body of markers. Colors can be specified as for
253 A color can be specified by a string representing a known color: 263 <varname>mcolors</varname>.
254 see <link linkend="color_list">color_list</link>. 264 This option supersedes <varname>mcolors</varname>.
255 A color can also be specified by a vector of 3 RGB values.
256 RGB values correspond to red, green and blue intensity between 0 and 1.
257 This option is superseded by argument <varname>mcolors</varname>.
258 </para> 265 </para>
259 </listitem> 266 </listitem>
260 </varlistentry> 267 </varlistentry>
261 <varlistentry> 268 <varlistentry>
262 <term>&lt;"linewidth", value&gt; or &lt;"thickness", value&gt;</term> 269 <term>"linewidth",value or "thickness",value</term>
263 <listitem> 270 <listitem>
264 <para> 271 <para>
265 Specify the thickness of the edge of the marker. 272 Specify the thickness of the edge for all markers.
266 The unit for the value is one point. 273 The unit for the value is one point.
267 </para> 274 </para>
268 </listitem> 275 </listitem>
269 </varlistentry> 276 </varlistentry>
270 <varlistentry>
271 <term>axes_handle</term>
272 <listitem>
273 <para>This optional argument forces the scatter plot to appear inside the
274 selected axes given by <literal>axes_handle</literal> rather than inside the
275 current axes, see <link linkend="gca">gca</link>.
276 </para>
277 </listitem>
278 </varlistentry>
279 <varlistentry>
280 <term>polyline</term>
281 <listitem>
282 <para>
283 Handle of the created polyline.
284 </para>
285 </listitem>
286 </varlistentry>
287 </variablelist> 277 </variablelist>
288 </refsection> 278 </refsection>
289 <refsection> 279 <refsection>
290 <title>Description</title> 280 <title>Description</title>
291 <warning>
292 <literal>scatter3()</literal> is obsolete and will be removed in Scilab 6.1.x.
293 Please use <literal>scatter3d()</literal> instead.
294 </warning>
295 <para> 281 <para>
296 <literal>scatter3d(x,y,z)</literal> creates a scatter plot with markers at the locations 282 <literal>scatter3d(x,y,z)</literal> creates a scatter plot with markers at the locations
297 specified by <varname>x</varname>, <varname>y</varname>, and <varname>z</varname>. 283 specified by <varname>x</varname>, <varname>y</varname>, and <varname>z</varname>.
@@ -308,8 +294,9 @@
308 <note> 294 <note>
309 <itemizedlist> 295 <itemizedlist>
310 <listitem> 296 <listitem>
311 To skip an argument, just replace it with <literal>[]</literal> as in 297 To skip an argument, just .. skip it, or replace it with <literal>[]</literal>,
312 <literal>scatter3d(x,y,z,[],mcolors)</literal>. 298 like in <literal>scatter3d(x,y,z, , mcolors)</literal> or in
299 <literal>scatter3d(x,y,z,[], mcolors)</literal>.
313 </listitem> 300 </listitem>
314 <listitem> 301 <listitem>
315 When the axes is rotated, the markers are automatically rotated as well in order 302 When the axes is rotated, the markers are automatically rotated as well in order
@@ -324,216 +311,243 @@
324 Create 3D scatter plot 311 Create 3D scatter plot
325 </para> 312 </para>
326 <programlisting role="example"><![CDATA[ 313 <programlisting role="example"><![CDATA[
327// x, y and z initialisation 314// Data: points on an hemisphere
328t = 1:200; 315azimuth = 0:12:359;
329x = t .* cos(t) .* sin(t); 316latitude = 3:12:89;
330y = t .* sin(t) .* sin(t); 317[az, lat] = ndgrid(azimuth, latitude);
331z = t .* cos(t); 318r = cosd(lat);
332// create 3D scatter plot 319x = 1.1*cosd(az+lat/3) .* r;
333scatter3d(x, y, z); 320y = 1.1*sind(az+lat/3) .* r;
334// modify rotation angles 321z = sind(lat);
335gca().rotation_angles = [60, 45]; 322
323clf
324gcf().color_map = parulacolormap(50);
325
326subplot(1,2,1) // Plot on the left
327// Markers size according to r
328scatter3d(x, y, z, r.^2*80);
329
330subplot(1,2,2) // Plot on the right
331options = list("fill", "markerEdgeColor","red","thickness",0.5);
332mcolors = az; // + colors according to the azimuth
333scatter3d(x, y, z, r.^2*80, mcolors, options(:));
334
335// Tuning axes rendering
336gcf().children.grid = [1 1 1]*color("grey50");
337gcf().children.rotation_angles = [83 -20];
336 ]]></programlisting> 338 ]]></programlisting>
337 <scilab:image> 339 <scilab:image>
338 t = 1:200 340 // Data: points on an hemisphere
339 x = t.*cos(t).*sin(t) 341 azimuth = 0:12:359;
340 y = t.*sin(t).*sin(t) 342 latitude = 3:12:89;
341 z = t.*cos(t) 343 [az, lat] = ndgrid(azimuth, latitude);
342 scatter3d(x,y,z) 344 r = cosd(lat);
343 gca().rotation_angles = [60, 45]; 345 x = 1.1*cosd(az+lat/3) .* r;
346 y = 1.1*sind(az+lat/3) .* r;
347 z = sind(lat);
348
349 clf
350 gcf().color_map = parulacolormap(50);
351
352 subplot(1,2,1) // Plot on the left
353 // Markers size according to r
354 scatter3d(x, y, z, r.^2*80);
355
356 subplot(1,2,2) // Plot on the right
357 options = list("fill", "markerEdgeColor","red","thickness",0.5);
358 mcolors = az; // + colors according to the azimuth
359 scatter3d(x, y, z, r.^2*80, mcolors, options(:));
360
361 // Tuning axes rendering
362 gcf().children.grid = [1 1 1]*color("grey50");
363 gcf().children.rotation_angles = [83 -20];
364 gcf().axes_size = [750 400];
344 </scilab:image> 365 </scilab:image>
345 <para> 366 <para>
346 Vary marker size 367 Styling the markers:
347 </para> 368 </para>
348 <programlisting role="example"><![CDATA[ 369 <programlisting role="example"><![CDATA[
349// x, y and z initialisation 370// Data
350t = 1:200; 371z = linspace(0, 25, 150);
351x = t .* cos(t) .* sin(t);
352y = t .* sin(t) .* sin(t);
353z = t .* cos(t);
354// size according to radius
355s = linspace(50, 1, length(t));
356// create 3D scatter plot
357scatter3d(x, y, z, s);
358// modify rotation angles
359gca().rotation_angles = [60, 45];
360 ]]></programlisting>
361 <scilab:image>
362 t = 1:200
363 x = t .* cos(t) .* sin(t)
364 y = t .* sin(t) .* sin(t)
365 z = t .* cos(t)
366 s = linspace(50, 1, length(t))
367 scatter3d(x, y, z, s)
368 gca().rotation_angles = [60, 45];
369 </scilab:image>
370 <para>
371 Vary marker size and color
372 </para>
373 <programlisting role="example"><![CDATA[
374// x, y and z initialisation
375t = 1:200;
376x = t .* cos(t) .* sin(t);
377y = t .* sin(t) .* sin(t);
378z = t .* cos(t);
379// size according to radius
380s = linspace(50, 1, length(t));
381// set color map
382gcf().color_map = coolcolormap(64);
383// color according to radius
384c = t;
385// create 3D scatter plot
386scatter3d(x, y, z, s, c);
387// modify rotation angles
388gca().rotation_angles = [60, 45];
389 ]]></programlisting>
390 <scilab:image>
391 t = 1:200
392 x = t.*cos(t).*sin(t)
393 y = t.*sin(t).*sin(t)
394 z = t.*cos(t)
395 s = linspace(50,1,length(t))
396 gcf().color_map = coolcolormap(64);
397 c = t
398 scatter3d(x,y,z,s,c)
399 gca().rotation_angles = [60, 45];
400 </scilab:image>
401 <para>
402 Fill the markers
403 </para>
404 <programlisting role="example"><![CDATA[
405// x, y and z initialisation
406z = linspace(0, 25, 200);
407x = z .* cos(z);
408y = z .* sin(z);
409// create 3D scatter plot
410scatter3d(x, y, z, "fill");
411// modify rotation angles
412gca().rotation_angles = [60, 45];
413 ]]></programlisting>
414 <scilab:image>
415 z = linspace(0,25,200)
416 x = z.*cos(z)
417 y = z.*sin(z)
418 scatter3d(x,y,z,"fill")
419 gca().rotation_angles = [60, 45];
420 </scilab:image>
421 <para>
422 Specify marker symbol
423 </para>
424 <programlisting role="example"><![CDATA[
425// x, y and z initialisation
426z = linspace(0, 25, 200);
427x = z .* cos(z); 372x = z .* cos(z);
428y = z .* sin(z); 373y = z .* sin(z);
429// create 3D scatter plot 374
375subplot(2,2,1)
376scatter3d(x, y, z)
377
378// Fill the markers
379subplot(2,2,2)
380scatter3d(x, y, z, , "turquoise", "fill")
381
382// Choose another marker shape
383subplot(2,2,3)
430scatter3d(x, y, z, "*"); 384scatter3d(x, y, z, "*");
431// modify rotation angles 385
432gca().rotation_angles = [60, 45]; 386// Customize the markers colors
433 ]]></programlisting> 387subplot(2,2,4)
434 <scilab:image>
435 z = linspace(0,25,200)
436 x = z.*cos(z)
437 y = z.*sin(z)
438 scatter3d(x,y,z,"*")
439 gca().rotation_angles = [60,45];
440 </scilab:image>
441 <para>
442 Change marker edge and face color
443 </para>
444 <programlisting role="example"><![CDATA[
445// x, y and z initialisation
446z = linspace(0, 25, 200);
447x = z .* cos(z);
448y = z .* sin(z);
449// create 3D scatter plot
450scatter3d(x, y, z,... 388scatter3d(x, y, z,...
451 "markerEdgeColor", "black",... 389 "markerEdgeColor", [1 0 0],...
452 "markerFaceColor", [0 .8 .8]); 390 "markerFaceColor", "yellow");
453// modify rotation angles 391
454gca().rotation_angles = [60, 45]; 392// Tune the 3D orientation of all axes
393gcf().children.rotation_angles = [65 35];
455 ]]></programlisting> 394 ]]></programlisting>
456 <scilab:image> 395 <scilab:image>
457 z = linspace(0,25,200) 396 // Data
458 x = z.*cos(z) 397 z = linspace(0, 25, 150);
459 y = z.*sin(z) 398 x = z .* cos(z);
460 scatter3d(x,y,z,... 399 y = z .* sin(z);
461 "markerEdgeColor","black",... 400
462 "markerFaceColor",[0 .8 .8]) 401 subplot(2,2,1)
463 gca().rotation_angles = [60, 45]; 402 scatter3d(x, y, z)
403
404 // Fill the markers
405 subplot(2,2,2)
406 scatter3d(x, y, z, , "turquoise", "fill")
407
408 // Choose another marker shape
409 subplot(2,2,3)
410 scatter3d(x, y, z, "*");
411
412 // Customize the markers colors
413 subplot(2,2,4)
414 scatter3d(x, y, z,...
415 "markerEdgeColor", [1 0 0],...
416 "markerFaceColor", "yellow");
417
418 // Tune the 3D orientation of all axes
419 gcf().children.rotation_angles = [65 35];
420
421 gcf().axes_size = [750 450];
464 </scilab:image> 422 </scilab:image>
465 <para> 423 <para>
466 Specify subplot for scatter plot 424 Specify subplot for scatter plot
467 </para> 425 </para>
468 <programlisting role="example"><![CDATA[ 426 <programlisting role="example"><![CDATA[
469// x, y and z initialisation 427// Data
470n = 20; 428n = 20;
471[x, y] = meshgrid(linspace(-2, 2, n)); 429[x, y] = meshgrid(linspace(-2, 2, n));
472z = exp(-x.^2 - y.^2); 430z = exp(-x.^2 - y.^2);
473// create 3D scatter subplot 431
474subplot(2,1,1)
475scatter3d(gca(), x(:), y(:), z(:));
476// modify rotation angles
477gca().rotation_angles = [60,45];
478// create 3D scatter subplot
479subplot(2,1,2) 432subplot(2,1,2)
480scatter3d(gca(), x(:), y(:), z(:), "markerFaceColor", [0 .8 .8]); 433axes2 = gca();
481// modify rotation angles 434subplot(2,1,1)
482gca().rotation_angles = [60,45]; 435
436scatter3d(x, y, z);
437scatter3d(axes2, x(:), y(:), z(:), "markerFaceColor", [0 .8 .8]);
438
439// Tune axes view
440Axes = gcf().children;
441Axes.rotation_angles = [60,45];
442Axes.grid = [1 1 1]*color("grey50");
483 ]]></programlisting> 443 ]]></programlisting>
484 <scilab:image> 444 <scilab:image>
485 n = 20 445 // Data
486 [x,y] = meshgrid(linspace(-2,2,n)) 446 n = 20;
487 z = exp(-x.^2 - y.^2) 447 [x, y] = meshgrid(linspace(-2, 2, n));
488 subplot(2,1,1) 448 z = exp(-x.^2 - y.^2);
489 scatter3d(gca(), x(:), y(:), z(:)) 449
490 gca().rotation_angles = [60, 45];
491 subplot(2,1,2) 450 subplot(2,1,2)
492 scatter3d(gca(),x(:),y(:),z(:),"markerFaceColor",[0 .8 .8]) 451 axes2 = gca();
493 gca().rotation_angles = [60, 45]; 452 subplot(2,1,1)
453
454 scatter3d(x, y, z);
455 scatter3d(axes2, x(:), y(:), z(:), "markerFaceColor", [0 .8 .8]);
456
457 // Tune axes view
458 Axes = gcf().children;
459 Axes.rotation_angles = [60,45];
460 Axes.grid = [1 1 1]*color("grey50");
461
462 gcf().axes_size = [500 350];
494 </scilab:image> 463 </scilab:image>
495 <para> 464 <para>
496 Modify scatter plot after creation 465 <emphasis role="bold">Use the handle to post-process the scatter plot</emphasis>:
497 </para> 466 </para>
498 <programlisting role="example"><![CDATA[ 467 <programlisting role="example"><![CDATA[
499// x, y and z initialisation 468// Data: points on an hemisphere
500t = 1:200; 469azimuth = 0:12:359;
501x = t .* cos(t) .* sin(t); 470latitude = 3:12:89;
502y = t .* sin(t) .* sin(t); 471[az, lat] = ndgrid(azimuth, latitude);
503z = t .* cos(t); 472r = cosd(lat);
504// size according to radius 473x = 1.1*cosd(az+lat/3) .* r;
505s = linspace(50, 1, length(t)); 474y = 1.1*sind(az+lat/3) .* r;
506// create 3D scatter plot 475z = sind(lat);
507scatter3d(x, y, z, s); 476
508// modify rotation angles 477clf
509gca().rotation_angles = [60,45]; 478
479subplot(1,2,1)
480scatter3d(x, y, z, r.^2*80);
481title("Initial plot", "fontsize",3)
482
483subplot(1,2,2)
484p = scatter3d(x, y, z, r.^2*80); // The same
485title("Final plot", "fontsize",3)
486
487// Let's post-process it through the handle:
488
489// 1) Let's set all markers at y < 0 in yellow, and others in orange
490np = size(p.data,1); // number of points
491tmp = ones(1,np) * color("orange");
492tmp(p.data(:,2)<0) = color("yellow");
493p.mark_background = tmp;
494
495// 2) and markers at x > 0 1.4 smaller than other
496tmp = p.data(:,1) > 0;
497p.mark_size(tmp) = p.mark_size(tmp)/1.4;
498
499// 3) Changing the edge color and thickness for all markers
500p.mark_foreground = color("red");
501p.thickness = 0.5;
502
503// Tuning axes
504Axes = gcf().children;
505Axes.rotation_angles = [82, -40];
506Axes.grid = [1 1 1]*color("grey60");
510 ]]></programlisting> 507 ]]></programlisting>
511 <scilab:image> 508 <scilab:image><![CDATA[
512 t = 1:200 509 // Data: points on an hemisphere
513 x = t.*cos(t).*sin(t) 510 azimuth = 0:12:359;
514 y = t.*sin(t).*sin(t) 511 latitude = 3:12:89;
515 z = t.*cos(t) 512 [az, lat] = ndgrid(azimuth, latitude);
516 s = linspace(50,1,length(t)) 513 r = cosd(lat);
517 p = scatter3d(x,y,z,s) 514 x = 1.1*cosd(az+lat/3) .* r;
518 gca().rotation_angles = [60,45]; 515 y = 1.1*sind(az+lat/3) .* r;
519 </scilab:image> 516 z = sind(lat);
520 <programlisting role="example"><![CDATA[ 517
521// modify polyline 518 clf
522p.mark_foreground = color(0.5, 0, 0); 519
523p.mark_background = color(0.5, 0.5, 0); 520 subplot(1,2,1)
524 ]]></programlisting> 521 scatter3d(x, y, z, r.^2*80);
525 <scilab:image> 522 title("Initial plot", "fontsize",3)
526 t = 1:200 523
527 x = t.*cos(t).*sin(t) 524 subplot(1,2,2)
528 y = t.*sin(t).*sin(t) 525 p = scatter3d(x, y, z, r.^2*80); // The same
529 z = t.*cos(t) 526 title("Final plot", "fontsize",3)
530 s = linspace(50,1,length(t)) 527
531 p = scatter3d(x,y,z,s) 528 // Let's post-process it through the handle:
532 set(gca(),"rotation_angles",[60,45]) 529
533 // modify polyline 530 // 1) Let's set all markers at y < 0 in yellow, and others in orange
534 p.mark_foreground = color(0.5, 0, 0) 531 np = size(p.data,1); // number of points
535 p.mark_background = color(0.5, 0.5, 0) 532 tmp = ones(1,np) * color("orange");
536 </scilab:image> 533 tmp(p.data(:,2)<0) = color("yellow");
534 p.mark_background = tmp;
535
536 // 2) and markers at x > 0 1.4 smaller than other
537 tmp = p.data(:,1) > 0;
538 p.mark_size(tmp) = p.mark_size(tmp)/1.4;
539
540 // 3) Changing the edge color and thickness for all markers
541 p.mark_foreground = color("red");
542 p.thickness = 0.5;
543
544 // Tuning axes
545 Axes = gcf().children;
546 Axes.rotation_angles = [82, -40];
547 Axes.grid = [1 1 1]*color("grey60");
548
549 gcf().axes_size = [700 350];
550 ]]></scilab:image>
537 </refsection> 551 </refsection>
538 <refsection role="see also"> 552 <refsection role="see also">
539 <title>See also</title> 553 <title>See also</title>
@@ -564,7 +578,21 @@ p.mark_background = color(0.5, 0.5, 0);
564 <revision> 578 <revision>
565 <revnumber>6.0.0</revnumber> 579 <revnumber>6.0.0</revnumber>
566 <revremark> 580 <revremark>
567 Function <function>scatter3d</function> introduced. 581 Function scatter3() introduced.
582 </revremark>
583 </revision>
584 <revision>
585 <revnumber>6.1.0</revnumber>
586 <revremark>
587 <itemizedlist>
588 <listitem>
589 Function scatter3() set obsolete. scatter3d() is introduced.
590 </listitem>
591 <listitem>
592 Colors can be specified as well with their "#RRGGBB" hexadecimal
593 standard code or their index in the color map.
594 </listitem>
595 </itemizedlist>
568 </revremark> 596 </revremark>
569 </revision> 597 </revision>
570 </revhistory> 598 </revhistory>
diff --git a/scilab/modules/graphics/help/en_US/axes_operations/replot.xml b/scilab/modules/graphics/help/en_US/axes_operations/replot.xml
index d9dfbfe..7d70953 100644
--- a/scilab/modules/graphics/help/en_US/axes_operations/replot.xml
+++ b/scilab/modules/graphics/help/en_US/axes_operations/replot.xml
@@ -14,7 +14,10 @@
14 * along with this program. 14 * along with this program.
15 * 15 *
16 --> 16 -->
17<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns: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="replot"> 17<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
18 xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
19 xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
20 xml:lang="en" xml:id="replot">
18 <refnamediv> 21 <refnamediv>
19 <refname>replot</refname> 22 <refname>replot</refname>
20 <refpurpose>reframes with new boundaries the current or a given set of axes 23 <refpurpose>reframes with new boundaries the current or a given set of axes
@@ -120,10 +123,14 @@
120 objects sizes into account. This ensures not clipping any object 123 objects sizes into account. This ensures not clipping any object
121 that would be beyond the targeted side of the axes. 124 that would be beyond the targeted side of the axes.
122 </para> 125 </para>
123 <para>When the <literal>tight_limits</literal> option is provided, 126 <para>
127 When the <literal>tight_limits</literal> option is provided,
124 its value is assigned to the <literal>.tight_limits</literal> 128 its value is assigned to the <literal>.tight_limits</literal>
125 attribute of each considered axes, in an axis-wise way. 129 attribute of each considered axes, in an axis-wise way.
126 </para> 130 </para>
131 <important>
132 gca() always refers to the same axes before and after calling replot(..).
133 </important>
127 </refsection> 134 </refsection>
128 <refsection role="examples"> 135 <refsection role="examples">
129 <title>Examples</title> 136 <title>Examples</title>
diff --git a/scilab/modules/graphics/help/en_US/color_management/colormap.xml b/scilab/modules/graphics/help/en_US/color_management/colormap.xml
index bf0b51c..b4ec3e6 100644
--- a/scilab/modules/graphics/help/en_US/color_management/colormap.xml
+++ b/scilab/modules/graphics/help/en_US/color_management/colormap.xml
@@ -2,8 +2,8 @@
2<!-- 2<!--
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) INRIA 4 * Copyright (C) INRIA
5 *
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises 5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
6 * Copyright (C) 2021 - Samuel GOUGEON
7 * 7 *
8 * This file is hereby licensed under the terms of the GNU GPL v2.0, 8 * This file is hereby licensed under the terms of the GNU GPL v2.0,
9 * pursuant to article 5.3.4 of the CeCILL v.2.1. 9 * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -13,7 +13,10 @@
13 * along with this program. 13 * along with this program.
14 * 14 *
15 --> 15 -->
16<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="colormap"> 16<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17 xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
18 xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
19 xml:lang="en" xml:id="colormap">
17 <refnamediv> 20 <refnamediv>
18 <refname>colormap</refname> 21 <refname>colormap</refname>
19 <refpurpose>using colormaps</refpurpose> 22 <refpurpose>using colormaps</refpurpose>
@@ -21,52 +24,118 @@
21 <refsection> 24 <refsection>
22 <title>Description</title> 25 <title>Description</title>
23 <para> 26 <para>
24 A colormap <literal>cmap</literal> is defined by a m x 3 matrix. m is the number of colors. 27 A colormap <literal>cmap</literal> is defined by a m x 3 matrix of Red, Green and Blue
25 Color number i is given as a 3-uple <literal>cmap(i,1)</literal>, <literal>cmap(i,2)</literal> 28 colors intensities in the [0,1] interval. m is the number of colors defined in the colormap.
26 <literal>cmap(i,3)</literal> 29 The color number i is given in the ith row as a 3-uple <literal>cmap(i,1)</literal>,
27 corresponding respectively to red, green and blue intensity between 30 <literal>cmap(i,2)</literal>, <literal>cmap(i,3)</literal>. For a given colormap,
28 0 and 1. 31 this index i identifies the color.
29 </para> 32 </para>
30 <para> 33 <para>
31 At the beginning, 32 colors are defined in the colormap. You can 34 The default factory colormap defines 32 colors. You can
32 change the colormap of a figure by using <literal>set(f,"color_map",cmap)</literal> 35 change the colormap of a figure by using <literal>f.color_map=cmap</literal>
33 where <literal>f</literal> is the handle of the figure. 36 where <literal>f</literal> is the handle of the figure.
34 </para> 37 </para>
35 <para> 38 <para>
36 Each color in the colormap has an id you have to use to specify color 39 Each color in the colormap has an index you have to use to specify color in most plot
37 in most plot functions. To see the ids, use function <link linkend="getcolor">getcolor</link>. 40 functions. To see the indices, use function <link linkend="getcolor">getcolor</link>.
41 </para>
42 <para>
43 A set of functions from <link linkend="autumncolormap">autumncolormap(n)</link>
44 to <link linkend="wintercolormap">wintercolormap(n)</link> provide swatches that can be
45 set to colormaps. They are illustrated here-below.
46 </para>
47 <para>
48 The colormap of the current figure can be retrieved with <literal>cmap = gcf().color_map</literal>.
38 </para> 49 </para>
39 <para> 50 <para>
40 The functions <link linkend="hotcolormap">hotcolormap</link>, <link linkend="jetcolormap">jetcolormap</link> and <link linkend="graycolormap">graycolormap</link> 51 The current default colormap can be retrieved with <literal>cmap = gdf().color_map</literal>.
41 provide colormaps with continuous variation of the colors.
42 </para> 52 </para>
43 <para> 53 <para>
44 You can get the default colormap by <literal>cmap=get(sdf(),"color_map")</literal>. 54 The factory default colormap can be retrieved with <literal>cmap = sdf().color_map</literal>.
45 </para> 55 </para>
46 </refsection> 56 </refsection>
47 <refsection> 57 <refsection>
58 <title>Sample</title>
59 <scilab:image localized="true">
60 cm = ["autumn" "bone" "cool" "copper" "gray" "hot" "hsv" "jet" "ocean" ..
61 "parula" "pink" "rainbow" "spring" "summer" "white" "winter"];
62
63 ncm = size(cm,"*");
64 indices = [];
65 cmap = [];
66 for i = 0:ncm-1
67 indices = [indices ; (1:100)+i*100];
68 execstr("cols = "+cm(i+1)+"colormap(100);");
69 cmap = [cmap ; cols];
70 end
71 f = gcf();
72 clf
73 f.color_map = cmap;
74 Matplot(indices)
75
76 xgrid([color("grey50") -1]);
77 gca().grid_position = "foreground";
78
79 title(_("Available swatches: #colormap(100)"), "fontsize", 4);
80 xlabel(_("Colors indices in [1,100]"), "fontsize", 3);
81 gca().y_ticks = tlist(["ticks" "locations" "labels"],16:-1:1,cm);
82 set(gca(), "font_size", 2, "sub_ticks",[4 0], "margins", [0.12 0.05 0.08 0.08]);
83
84 gcf().axes_size = [650 650];
85 </scilab:image>
86 </refsection>
87 <refsection>
48 <title>Examples</title> 88 <title>Examples</title>
49 <programlisting role="example"><![CDATA[ 89 <programlisting role="example"><![CDATA[
50n=64; 90n = 64;
51r=linspace(0,1,n)'; 91r = linspace(0,1,n)';
52g=linspace(1,0,n)'; 92g = linspace(1,0,n)';
53b=ones(r); 93b = ones(r);
54cmap=[r g b]; 94cmap = [r g b];
55f=gcf(); f.color_map=cmap; 95f = gcf(); f.color_map = cmap;
56plot3d1() 96plot3d1()
57f.color_map=get(sdf(),"color_map"); 97f.color_map = gdf().color_map; // restores to the default colormap
58 ]]></programlisting> 98 ]]></programlisting>
59 <scilab:image> 99 <para/>
60 n=64; 100 <programlisting role="example"><![CDATA[
61 r=linspace(0,1,n)'; 101gdf().color_map
62 g=linspace(1,0,n)'; 102 ]]></programlisting>
63 b=ones(r); 103 <screen><![CDATA[
64 cmap=[r g b]; 104--> gdf().color_map
65 f=gcf(); f.color_map=cmap; 105 ans =
66 plot3d1() 106 0. 0. 0.
67 f.color_map=get(sdf(),"color_map"); 107 0. 0. 1.
68 </scilab:image> 108 0. 1. 0.
69 109 0. 1. 1.
110 1. 0. 0.
111 1. 0. 1.
112 1. 1. 0.
113 1. 1. 1.
114 0. 0. 0.5647059
115 0. 0. 0.6901961
116 0. 0. 0.8156863
117 0.5294118 0.8078431 1.
118 0. 0.5647059 0.
119 0. 0.6901961 0.
120 0. 0.8156863 0.
121 0. 0.5647059 0.5647059
122 0. 0.6901961 0.6901961
123 0. 0.8156863 0.8156863
124 0.5647059 0. 0.
125 0.6901961 0. 0.
126 0.8156863 0. 0.
127 0.5647059 0. 0.5647059
128 0.6901961 0. 0.6901961
129 0.8156863 0. 0.8156863
130 0.5019608 0.1882353 0.
131 0.627451 0.2509804 0.
132 0.7529412 0.3764706 0.
133 1. 0.5019608 0.5019608
134 1. 0.627451 0.627451
135 1. 0.7529412 0.7529412
136 1. 0.8784314 0.8784314
137 1. 0.8431373 0.
138]]></screen>
70 </refsection> 139 </refsection>
71 <refsection role="see also"> 140 <refsection role="see also">
72 <title>See also</title> 141 <title>See also</title>
@@ -125,6 +194,9 @@ f.color_map=get(sdf(),"color_map");
125 <member> 194 <member>
126 <link linkend="getcolor">getcolor</link> 195 <link linkend="getcolor">getcolor</link>
127 </member> 196 </member>
197 <member>
198 <link linkend="colordef">colordef</link>
199 </member>
128 </simplelist> 200 </simplelist>
129 </refsection> 201 </refsection>
130</refentry> 202</refentry>
diff --git a/scilab/modules/graphics/help/en_US/color_management/getcolor.xml b/scilab/modules/graphics/help/en_US/color_management/getcolor.xml
index e36aaf6..023ab48 100644
--- a/scilab/modules/graphics/help/en_US/color_management/getcolor.xml
+++ b/scilab/modules/graphics/help/en_US/color_management/getcolor.xml
@@ -2,8 +2,8 @@
2<!-- 2<!--
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) INRIA 4 * Copyright (C) INRIA
5 *
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises 5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
6 * Copyright (C) 2021 - Samuel GOUGEON
7 * 7 *
8 * This file is hereby licensed under the terms of the GNU GPL v2.0, 8 * This file is hereby licensed under the terms of the GNU GPL v2.0,
9 * pursuant to article 5.3.4 of the CeCILL v.2.1. 9 * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -13,15 +13,20 @@
13 * along with this program. 13 * along with this program.
14 * 14 *
15 --> 15 -->
16<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="getcolor"> 16<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17 xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
18 xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
19 xml:lang="en" xml:id="getcolor">
17 <refnamediv> 20 <refnamediv>
18 <refname>getcolor</refname> 21 <refname>getcolor</refname>
19 <refpurpose>opens a dialog to show colors in the current colormap</refpurpose> 22 <refpurpose>opens a dialog to show colors of the current or default colormap</refpurpose>
20 </refnamediv> 23 </refnamediv>
21 <refsynopsisdiv> 24 <refsynopsisdiv>
22 <title>Syntax</title> 25 <title>Syntax</title>
23 <synopsis>c=getcolor(title,[cini]) 26 <synopsis>
24 c=getcolor() 27 c = getcolor()
28 c = getcolor(title)
29 c = getcolor(title, cini)
25 </synopsis> 30 </synopsis>
26 </refsynopsisdiv> 31 </refsynopsisdiv>
27 <refsection> 32 <refsection>
@@ -36,13 +41,13 @@
36 <varlistentry> 41 <varlistentry>
37 <term>cini</term> 42 <term>cini</term>
38 <listitem> 43 <listitem>
39 <para>initial selected color id. Default value is 1.</para> 44 <para>initial selected color index. Default value is 1.</para>
40 </listitem> 45 </listitem>
41 </varlistentry> 46 </varlistentry>
42 <varlistentry> 47 <varlistentry>
43 <term>c</term> 48 <term>c</term>
44 <listitem> 49 <listitem>
45 <para>selected color id or [] if the selection is cancelled.</para> 50 <para>index of the selected color, or [] if the selection is canceled.</para>
46 </listitem> 51 </listitem>
47 </varlistentry> 52 </varlistentry>
48 </variablelist> 53 </variablelist>
@@ -50,26 +55,47 @@
50 <refsection> 55 <refsection>
51 <title>Description</title> 56 <title>Description</title>
52 <para> 57 <para>
53 <literal>getcolor</literal> opens a window displaying the palette of the current colormap. 58 <literal>getcolor</literal> opens a window displaying the palette of the current
54 The user can click on a color to show its id and RGB values. 59 colormap, or of the default one if no graphical figure exists.
55 <literal>getcolor</literal> returns the id of the selected color or [] if the "Cancel" button has been clicked or the window closed. 60 The user can click on a color to show its index and its RGB values
61 in the bottom bar.
62 <literal>getcolor</literal> returns the index of the selected color, or [] if the "Cancel"
63 button has been clicked or the window has been closed.
56 </para> 64 </para>
57 </refsection> 65 </refsection>
58 <refsection> 66 <refsection>
59 <title>Examples</title> 67 <title>Examples</title>
60 <programlisting role="example"><![CDATA[ 68 <programlisting role="example"><![CDATA[
61getcolor(); 69c = getcolor();
62 70
63getcolor("Title foo"); 71c = getcolor("Title foo", color("red")); // preselects the red
64 72
65getcolor("foo",21); // Select the red 73c = getcolor("Please choose a color");
66 ]]></programlisting> 74 ]]></programlisting>
75 <para/>
76 <inlinemediaobject>
77 <imageobject>
78 <imagedata fileref="../../images/getcolor.png"/>
79 </imageobject>
80 </inlinemediaobject>
81 <para/>
82 <screen><![CDATA[
83--> c = getcolor("Please choose a color")
84 c =
85 28.
86]]></screen>
67 </refsection> 87 </refsection>
68 88
69 <refsection role="see also"> 89 <refsection role="see also">
70 <title>See also</title> 90 <title>See also</title>
71 <simplelist type="inline"> 91 <simplelist type="inline">
72 <member> 92 <member>
93 <link linkend="uigetcolor">uigetcolor</link>
94 </member>
95 <member>
96 <link linkend="color_list">color_list</link>
97 </member>
98 <member>
73 <link linkend="color">color</link> 99 <link linkend="color">color</link>
74 </member> 100 </member>
75 <member> 101 <member>
diff --git a/scilab/modules/graphics/help/en_US/color_management/uigetcolor.xml b/scilab/modules/graphics/help/en_US/color_management/uigetcolor.xml
index 13846a8..e6b828f 100644
--- a/scilab/modules/graphics/help/en_US/color_management/uigetcolor.xml
+++ b/scilab/modules/graphics/help/en_US/color_management/uigetcolor.xml
@@ -1,5 +1,8 @@
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<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="uigetcolor"> 2<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
3 xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
4 xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
5 xml:lang="en" xml:id="uigetcolor">
3 <refnamediv> 6 <refnamediv>
4 <refname>uigetcolor</refname> 7 <refname>uigetcolor</refname>
5 <refpurpose>Opens a dialog for selecting a color.</refpurpose> 8 <refpurpose>Opens a dialog for selecting a color.</refpurpose>
@@ -8,12 +11,16 @@
8 <title>Syntax</title> 11 <title>Syntax</title>
9 <synopsis> 12 <synopsis>
10 uigetcolor() 13 uigetcolor()
11 RGB = uigetcolor([title]) 14
12 RGB = uigetcolor([title,] defaultRGB) 15 RGB = uigetcolor()
13 RGB = uigetcolor([title,] defaultRed, defaultGreen, defaultBlue) 16 RGB = uigetcolor(defaultRGB)
14 [R, G, B] = uigetcolor([title]) 17 RGB = uigetcolor(defaultRed, defaultGreen, defaultBlue)
15 [R, G, B] = uigetcolor([title,] defaultRGB) 18 RGB = uigetcolor(title, ..)
16 [R, G, B] = uigetcolor([title,] defaultRed, defaultGreen, defaultBlue) 19
20 [R, G, B] = uigetcolor()
21 [R, G, B] = uigetcolor(defaultRGB)
22 [R, G, B] = uigetcolor(defaultRed, defaultGreen, defaultBlue)
23 [R, G, B] = uigetcolor(title, ..)
17 </synopsis> 24 </synopsis>
18 </refsynopsisdiv> 25 </refsynopsisdiv>
19 <refsection> 26 <refsection>
@@ -22,62 +29,56 @@
22 <varlistentry> 29 <varlistentry>
23 <term>title</term> 30 <term>title</term>
24 <listitem> 31 <listitem>
25 <para>String: Optional argument, the title to display in the dialog. Default value is "Color Chooser".</para> 32 <para>
33 String: Optional argument, the title to display in the dialog.
34 Default value is "Color Chooser".
35 </para>
26 </listitem> 36 </listitem>
27 </varlistentry> 37 </varlistentry>
28 <varlistentry> 38 <varlistentry>
29 <term>defaultRGB</term> 39 <term>defaultRGB</term>
30 <listitem> 40 <listitem>
31 <para>1x3 vector: the default values for Red, Green and Blue values given as a vector [red, green, blue].</para> 41 <para>
42 1x3 vector [red, green, blue] of default values in [0, 255] for Red, Green
43 and Blue intensities.
44 </para>
32 </listitem> 45 </listitem>
33 </varlistentry> 46 </varlistentry>
34 <varlistentry> 47 <varlistentry>
35 <term>defaultRed</term> 48 <term>defaultRed, defaultGreen, defaultBlue</term>
36 <listitem> 49 <listitem>
37 <para>Scalar: the default value for red.</para> 50 <para>
38 </listitem> 51 Integers in [0, 255]: Scalar default values for Red, Green, and Blue
39 </varlistentry> 52 intensities.
40 <varlistentry> 53 </para>
41 <term>defaultGreen</term>
42 <listitem>
43 <para>Scalar: the default value for green.</para>
44 </listitem>
45 </varlistentry>
46 <varlistentry>
47 <term>defaultBlue</term>
48 <listitem>
49 <para>Scalar: the default value for blue.</para>
50 </listitem> 54 </listitem>
51 </varlistentry> 55 </varlistentry>
52 <varlistentry> 56 <varlistentry>
53 <term>RGB</term> 57 <term>RGB</term>
54 <listitem> 58 <listitem>
55 <para>1x3 vector: the values for Red, Green and Blue values given as a vector [red, green, blue] or [] if the user cancels.</para> 59 <para>
56 </listitem> 60 1x3 vector [red, green, blue] of values in [0, 255] for Red, Green and Blue
57 </varlistentry> 61 intensities, or [] if the user cancels.
58 <varlistentry> 62 </para>
59 <term>R</term>
60 <listitem>
61 <para>Scalar: the value for red or [] if the user cancels.</para>
62 </listitem>
63 </varlistentry>
64 <varlistentry>
65 <term>G</term>
66 <listitem>
67 <para>Scalar: the value for green or [] if the user cancels.</para>
68 </listitem> 63 </listitem>
69 </varlistentry> 64 </varlistentry>
70 <varlistentry> 65 <varlistentry>
71 <term>B</term> 66 <term>R, G, B</term>
72 <listitem> 67 <listitem>
73 <para>Scalar: the value for blue or [] if the user cancels.</para> 68 <para>
69 Integers in [0, 255]: Scalar values for Red, Green and Blue intensities,
70 or [] if the user cancels.
71 </para>
74 </listitem> 72 </listitem>
75 </varlistentry> 73 </varlistentry>
76 </variablelist> 74 </variablelist>
77 </refsection> 75 </refsection>
78 <refsection> 76 <refsection>
79 <title>Description</title> 77 <title>Description</title>
80 <para>Creates a dialog window for selecting a color. All (default and returned) values must be in the interval [0 255].</para> 78 <para>
79 Creates a dialog window for selecting a color. All (default and returned) values are
80 in the interval [0 255].
81 </para>
81 </refsection> 82 </refsection>
82 <refsection> 83 <refsection>
83 <title>Examples</title> 84 <title>Examples</title>
@@ -85,8 +86,18 @@
85uigetcolor() 86uigetcolor()
86[R, G, B] = uigetcolor([255 128 0]) 87[R, G, B] = uigetcolor([255 128 0])
87RBG = uigetcolor(0, 128, 255) 88RBG = uigetcolor(0, 128, 255)
88RBG = uigetcolor("My color chooser", 0, 128, 255) 89RBG = uigetcolor("My color chooser", 250, 150, 50)
89 ]]></programlisting> 90 ]]></programlisting>
91 <para/>
92 <inlinemediaobject>
93 <imageobject>
94 <imagedata fileref="../../images/uigetcolor_1.png"/>
95 </imageobject>
96 <para/>
97 <imageobject>
98 <imagedata fileref="../../images/uigetcolor_RGB.png"/>
99 </imageobject>
100 </inlinemediaobject>
90 </refsection> 101 </refsection>
91 <refsection role="see also"> 102 <refsection role="see also">
92 <title>See also</title> 103 <title>See also</title>
diff --git a/scilab/modules/graphics/help/en_US/load_save/xsave.xml b/scilab/modules/graphics/help/en_US/load_save/xsave.xml
index 53c5ed0..a675d67 100644
--- a/scilab/modules/graphics/help/en_US/load_save/xsave.xml
+++ b/scilab/modules/graphics/help/en_US/load_save/xsave.xml
@@ -2,8 +2,8 @@
2<!-- 2<!--
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) ENPC - Jean-Philippe Chancelier 4 * Copyright (C) ENPC - Jean-Philippe Chancelier
5 *
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises 5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
6 * Copyright (C) 2020 - Samuel GOUGEON
7 * 7 *
8 * This file is hereby licensed under the terms of the GNU GPL v2.0, 8 * This file is hereby licensed under the terms of the GNU GPL v2.0,
9 * pursuant to article 5.3.4 of the CeCILL v.2.1. 9 * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -13,7 +13,10 @@
13 * along with this program. 13 * along with this program.
14 * 14 *
15 --> 15 -->
16<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="xsave"> 16<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17 xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
18 xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
19 xml:lang="en" xml:id="xsave">
17 <refnamediv> 20 <refnamediv>
18 <refname>xsave</refname> 21 <refname>xsave</refname>
19 <refpurpose>save graphics into a 22 <refpurpose>save graphics into a
@@ -22,7 +25,11 @@
22 </refnamediv> 25 </refnamediv>
23 <refsynopsisdiv> 26 <refsynopsisdiv>
24 <title>Syntax</title> 27 <title>Syntax</title>
25 <synopsis>xsave(filename,[win_num])</synopsis> 28 <synopsis>
29 xsave(filename)
30 xsave(filename, win_num)
31 xsave(filename, win_handle)
32 </synopsis>
26 </refsynopsisdiv> 33 </refsynopsisdiv>
27 <refsection> 34 <refsection>
28 <title>Arguments</title> 35 <title>Arguments</title>
@@ -30,15 +37,23 @@
30 <varlistentry> 37 <varlistentry>
31 <term>file_name</term> 38 <term>file_name</term>
32 <listitem> 39 <listitem>
33 <para>string, name of the file.</para> 40 string, name of the file.
41 <para/>
34 </listitem> 42 </listitem>
35 </varlistentry> 43 </varlistentry>
36 <varlistentry> 44 <varlistentry>
37 <term>win_num</term> 45 <term>win_num</term>
38 <listitem> 46 <listitem>
39 <para>integer, the graphics window number. If not given, the current 47 integer: the graphics window number. If not given, the current
40 graphics window is used. 48 graphics window is considered.
41 </para> 49 <para/>
50 </listitem>
51 </varlistentry>
52 <varlistentry>
53 <term>win_handle</term>
54 <listitem>
55 handle of the figure to save. By default, gcf() is used.
56 <para/>
42 </listitem> 57 </listitem>
43 </varlistentry> 58 </varlistentry>
44 </variablelist> 59 </variablelist>
@@ -47,29 +62,28 @@
47 <title>Description</title> 62 <title>Description</title>
48 <para> 63 <para>
49 <literal>xsave</literal> saves the graphics contained in the graphics window 64 <literal>xsave</literal> saves the graphics contained in the graphics window
50 <literal>win_num</literal> in the binary file <literal>file_name</literal>. and can be 65 <literal>win_num</literal> in the binary file <literal>file_name</literal>, and can be
51 reloaded with <literal>xload</literal>. 66 reloaded with <literal>xload</literal>.
52 </para> 67 </para>
53 <para> 68 <note>
54 Since Scilab 5.0, all <link linkend="uimenu">uimenu</link> or <link linkend="uicontrol">uicontrol</link> handles are also saved. 69 <literal>xsave(file_name, win_num)</literal> and
55 </para> 70 <literal>xsave(file_name, win_handle)</literal> are just shortcuts respectively for
56 <para> 71 <literal>h=findobj("figure_id", win_num); save(file_name, "h")</literal> and
57 For graphics <literal>xsave(file_name,win_num)</literal> use preferably 72 <literal>save(file_name, "win_handle")</literal>, that can be used directly.
58 <literal>save(file_name,scf(win_num))</literal>. 73 </note>
59 </para>
60 </refsection> 74 </refsection>
61 <refsection> 75 <refsection>
62 <title>Examples</title> 76 <title>Examples</title>
63 <programlisting role="example"><![CDATA[ 77 <programlisting role="example"><![CDATA[
64t=0:0.01:10; 78t = 0:0.01:10;
65subplot(211),plot2d(t,sin(t)) 79subplot(211), plot2d(t,sin(t))
66subplot(212),plot2d(t,sin(3*t)) 80subplot(212), plot2d(t,sin(3*t))
67xsave(TMPDIR + "/foo.scg", gcf()) 81xsave(TMPDIR + "/foo.scg", gcf())
68clf() 82clf()
69xload(TMPDIR + "/foo.scg") 83xload(TMPDIR + "/foo.scg")
70 84
71a=gca(); 85a = gca();
72curve=a.children.children; //handle on the curve 86curve = a.children.children; // handle on the curve
73save(TMPDIR + "/foo.scg", "curve") 87save(TMPDIR + "/foo.scg", "curve")
74delete(curve) 88delete(curve)
75load(TMPDIR + "/foo.scg") 89load(TMPDIR + "/foo.scg")
@@ -89,4 +103,17 @@ load(TMPDIR + "/foo.scg")
89 </member> 103 </member>
90 </simplelist> 104 </simplelist>
91 </refsection> 105 </refsection>
106
107 <refsection role="history">
108 <title>History</title>
109 <revhistory>
110 <revision>
111 <revnumber>5.0</revnumber>
112 <revdescription>
113 All <link linkend="uimenu">uimenu</link> and <link linkend="uicontrol">uicontrol</link>
114 elements of the figure are now saved as well.
115 </revdescription>
116 </revision>
117 </revhistory>
118 </refsection>
92</refentry> 119</refentry>
diff --git a/scilab/modules/graphics/help/en_US/polygon/polyline_properties.xml b/scilab/modules/graphics/help/en_US/polygon/polyline_properties.xml
index f440930..8b428ab 100644
--- a/scilab/modules/graphics/help/en_US/polygon/polyline_properties.xml
+++ b/scilab/modules/graphics/help/en_US/polygon/polyline_properties.xml
@@ -117,7 +117,7 @@
117 a.children.children.thickness = 2; 117 a.children.children.thickness = 2;
118 set(a, "axes_visible",["off" "on" "off"], "sub_ticks",[1 0]); 118 set(a, "axes_visible",["off" "on" "off"], "sub_ticks",[1 0]);
119 a.margins(1) = 0.15; 119 a.margins(1) = 0.15;
120 a.y_ticks=tlist(["ticks" "locations" "labels"],1:10,msprintf("%d\n",(1:10)')') 120 a.y_ticks=tlist(["ticks" "locations" "labels"],1:10,msprintf("%d\n",(10:-1:1)')')
121 ylabel("line_style value", "fontsize", 3) 121 ylabel("line_style value", "fontsize", 3)
122 gcf().axes_size = [300 185]; 122 gcf().axes_size = [300 185];
123 </scilab:image> 123 </scilab:image>
diff --git a/scilab/modules/graphics/help/en_US/property/get.xml b/scilab/modules/graphics/help/en_US/property/get.xml
index d7f78e0..cdf90c1 100644
--- a/scilab/modules/graphics/help/en_US/property/get.xml
+++ b/scilab/modules/graphics/help/en_US/property/get.xml
@@ -3,8 +3,8 @@
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) INRIA - Djalel Abdemouche 4 * Copyright (C) INRIA - Djalel Abdemouche
5 * Copyright (C) Digiteo - 2009 - Jean-Baptiste Silvy 5 * Copyright (C) Digiteo - 2009 - Jean-Baptiste Silvy
6 *
7 * Copyright (C) 2012 - 2016 - Scilab Enterprises 6 * Copyright (C) 2012 - 2016 - Scilab Enterprises
7 * Copyright (C) 2020 - Samuel GOUGEON
8 * 8 *
9 * This file is hereby licensed under the terms of the GNU GPL v2.0, 9 * This file is hereby licensed under the terms of the GNU GPL v2.0,
10 * pursuant to article 5.3.4 of the CeCILL v.2.1. 10 * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -14,19 +14,31 @@
14 * along with this program. 14 * along with this program.
15 * 15 *
16 --> 16 -->
17<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns: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="get"> 17<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
18 xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
19 xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
20 xml:lang="en" xml:id="get">
18 <refnamediv> 21 <refnamediv>
19 <refname>get</refname> 22 <refname>get</refname>
20 <refpurpose>Retrieve a property value from a graphics 23 <refpurpose>
21 entity or an User Interface object. 24 Gets the handle of a graphical or User Interface object, or the property's value of objects.
22 </refpurpose> 25 </refpurpose>
23 </refnamediv> 26 </refnamediv>
24 <refsynopsisdiv> 27 <refsynopsisdiv>
25 <title>Syntax</title> 28 <title>Syntax</title>
26 <synopsis>h=get(prop) 29 <synopsis>
27 val=get(h,prop) 30 h = get(0) // console
28 val=get(handlePath,prop) 31 h = get(tag)
29 val=h.prop 32 h = get(tagsPath)
33 h = get(key)
34 fids = get("figures_id")
35
36 val = H.prop
37 val = H(prop)
38 val = get(0, prop)
39 val = get(H, prop)
40 val = get(tag, prop)
41 val = get(tagsPath, prop)
30 </synopsis> 42 </synopsis>
31 </refsynopsisdiv> 43 </refsynopsisdiv>
32 <refsection> 44 <refsection>
@@ -35,155 +47,416 @@
35 <varlistentry> 47 <varlistentry>
36 <term>h</term> 48 <term>h</term>
37 <listitem> 49 <listitem>
38 <para>handle, the handle of the entity to retrieve a property. 50 <para>
39 <literal>h</literal> can be a vector of handles, in which case get returns 51 Scalar handle of the first found targeted graphical or user Interface object.
40 the property value for all objects contained in h. <literal>h</literal> can also be <emphasis>0</emphasis> to get the root object properties. Calling <literal>get(0)</literal> will return a "Console" handle with configuration <link linkend="console_properties">properties</link>.
41 </para>