[graphics] better logarithmic plots
[scilab.git] / scilab / modules / graphics / help / en_US / 2d_plot / loglog.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) INRIA - 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>