More samples in the graphic help pages Note that they are automatically generated...
[scilab.git] / scilab / modules / graphics / help / en_US / 2d_plot / polarplot.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
5  * 
6  * This file must be used under the terms of the CeCILL.
7  * This source file is licensed as described in the file COPYING, which
8  * you should have received as part of this distribution.  The terms
9  * are also available at    
10  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
11  *
12  -->
13 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="polarplot">
14   <info>
15     <pubdate>$LastChangedDate$</pubdate>
16   </info>
17   <refnamediv>
18     <refname>polarplot</refname>
19     <refpurpose>Plot polar
20       coordinates
21     </refpurpose>
22   </refnamediv>
23   <refsynopsisdiv>
24     <title>Calling Sequence</title>
25     <synopsis>polarplot(theta,rho,[style,strf,leg,rect])
26       polarplot(theta,rho,&lt;opt_args&gt;)
27     </synopsis>
28   </refsynopsisdiv>
29   <refsection>
30     <title>Arguments</title>
31     <variablelist>
32       <varlistentry>
33         <term>rho</term>
34         <listitem>
35           <para>a vector, the radius values</para>
36         </listitem>
37       </varlistentry>
38       <varlistentry>
39         <term>theta</term>
40         <listitem>
41           <para>a vector with same size than rho, the angle values.</para>
42         </listitem>
43       </varlistentry>
44       <varlistentry>
45         <term>&lt;opt_args&gt;</term>
46         <listitem>
47           <para>
48             a sequence of statements <literal>key1=value1, key2=value2</literal>, ... where keys may be
49             <literal>style</literal>,<literal>leg</literal>,<literal>rect</literal>,<literal>strf</literal>
50             or <literal>frameflag</literal>
51           </para>
52         </listitem>
53       </varlistentry>
54       <varlistentry>
55         <term>style</term>
56         <listitem>
57           <para>is a real row vector of size nc. The style to use for curve
58             <literal>i</literal> is defined by <literal>style(i)</literal>. The default
59             style is <literal>1:nc</literal> (1 for the first curve, 2 for the second,
60             etc.).
61           </para>
62           <variablelist>
63             <varlistentry>
64               <term>-</term>
65               <listitem>
66                 <para>
67                   if <literal>style(i)</literal> is negative, the curve is plotted
68                   using the mark with id <literal>abs(style(i))+1</literal>; use
69                   <literal>xset()</literal> to see the mark ids.
70                 </para>
71               </listitem>
72             </varlistentry>
73             <varlistentry>
74               <term>-</term>
75               <listitem>
76                 <para>
77                   if <literal>style(i)</literal> is strictly positive, a plain
78                   line with color id <literal>style(i)</literal> or a dashed line with
79                   dash id <literal>style(i)</literal> is used; use <literal>xset()</literal>
80                   to see the color ids.
81                 </para>
82               </listitem>
83             </varlistentry>
84             <varlistentry>
85               <term>-</term>
86               <listitem>
87                 <para>
88                   When only one curve is drawn, <literal>style</literal> can be
89                   the row vector of size 2 <literal>[sty,pos]</literal> where
90                   <literal>sty</literal> is used to specify the style and
91                   <literal>pos</literal> is an integer ranging from 1 to 6 which
92                   specifies a position to use for the caption. This can be
93                   useful when a user wants to draw multiple curves on a plot by
94                   calling the function <literal>plot2d</literal> several times and
95                   wants to give a caption for each curve.
96                 </para>
97               </listitem>
98             </varlistentry>
99           </variablelist>
100         </listitem>
101       </varlistentry>
102       <varlistentry>
103         <term>strf</term>
104         <listitem>
105           <para>
106             is a string of length 3 <literal>"xy0"</literal>.
107           </para>
108           <variablelist>
109             <varlistentry>
110               <term>default</term>
111               <listitem>
112                 <para>
113                   The default is <literal>"030"</literal>.
114                 </para>
115               </listitem>
116             </varlistentry>
117             <varlistentry>
118               <term>x</term>
119               <listitem>
120                 <para>controls the display of captions,</para>
121                 <variablelist>
122                   <varlistentry>
123                     <term>x=0</term>
124                     <listitem>
125                       <para>no captions.</para>
126                     </listitem>
127                   </varlistentry>
128                   <varlistentry>
129                     <term>x=1</term>
130                     <listitem>
131                       <para>captions are displayed. They are given by the
132                         optional argument <literal>leg</literal>.
133                       </para>
134                     </listitem>
135                   </varlistentry>
136                 </variablelist>
137               </listitem>
138             </varlistentry>
139             <varlistentry>
140               <term>y</term>
141               <listitem>
142                 <para>controls the computation of the frame. same as
143                   frameflag
144                 </para>
145                 <variablelist>
146                   <varlistentry>
147                     <term>y=0</term>
148                     <listitem>
149                       <para>the current boundaries (set by a previous call to
150                         another high level plotting function) are used. Useful
151                         when superposing multiple plots.
152                       </para>
153                     </listitem>
154                   </varlistentry>
155                   <varlistentry>
156                     <term>y=1</term>
157                     <listitem>
158                       <para>
159                         the optional argument <literal>rect</literal> is used to
160                         specify the boundaries of the plot.
161                       </para>
162                     </listitem>
163                   </varlistentry>
164                   <varlistentry>
165                     <term>y=2</term>
166                     <listitem>
167                       <para>the boundaries of the plot are computed using min
168                         and max values of <literal>x</literal> and
169                         <literal>y</literal>.
170                       </para>
171                     </listitem>
172                   </varlistentry>
173                   <varlistentry>
174                     <term>y=3</term>
175                     <listitem>
176                       <para>
177                         like <literal>y=1</literal> but produces isoview
178                         scaling.
179                       </para>
180                     </listitem>
181                   </varlistentry>
182                   <varlistentry>
183                     <term>y=4</term>
184                     <listitem>
185                       <para>
186                         like <literal>y=2</literal> but produces isoview
187                         scaling.
188                       </para>
189                     </listitem>
190                   </varlistentry>
191                   <varlistentry>
192                     <term>y=5</term>
193                     <listitem>
194                       <para>
195                         like <literal>y=1</literal> but <literal>plot2d</literal> can
196                         change the boundaries of the plot and the ticks of the
197                         axes to produce pretty graduations. When the zoom button
198                         is activated, this mode is used.
199                       </para>
200                     </listitem>
201                   </varlistentry>
202                   <varlistentry>
203                     <term>y=6</term>
204                     <listitem>
205                       <para>
206                         like <literal>y=2</literal> but <literal>plot2d</literal> can
207                         change the boundaries of the plot and the ticks of the
208                         axes to produce pretty graduations. When the zoom button
209                         is activated, this mode is used.
210                       </para>
211                     </listitem>
212                   </varlistentry>
213                   <varlistentry>
214                     <term>y=7</term>
215                     <listitem>
216                       <para>
217                         like <literal>y=5</literal> but the scale of the new
218                         plot is merged with the current scale.
219                       </para>
220                     </listitem>
221                   </varlistentry>
222                   <varlistentry>
223                     <term>y=8</term>
224                     <listitem>
225                       <para>
226                         like <literal>y=6</literal> but the scale of the new
227                         plot is merged with the current scale.
228                       </para>
229                     </listitem>
230                   </varlistentry>
231                 </variablelist>
232               </listitem>
233             </varlistentry>
234           </variablelist>
235         </listitem>
236       </varlistentry>
237       <varlistentry>
238         <term>leg</term>
239         <listitem>
240           <para>a string. It is used when the first character x of argument
241             <literal>strf</literal> is 1. <literal>leg</literal> has the form
242             <literal>"leg1@leg2@...."</literal> where <literal>leg1</literal>,
243             <literal>leg2</literal>, etc. are respectively the captions of the first
244             curve, of the second curve, etc. The default is <literal>""</literal>.
245           </para>
246         </listitem>
247       </varlistentry>
248       <varlistentry>
249         <term>rect</term>
250         <listitem>
251           <para>This argument is used when the second character y of argument
252             <literal>strf</literal> is 1, 3 or 5. It is a row vector of size 4 and
253             gives the dimension of the frame:
254             <literal>rect=[xmin,ymin,xmax,ymax]</literal>.
255           </para>
256         </listitem>
257       </varlistentry>
258     </variablelist>
259   </refsection>
260   <refsection>
261     <title>Description</title>
262     <para>polarplot creates a polar coordinate plot of the angle theta versus the
263       radius rho. theta is the angle from the x-axis to the radius vector
264       specified in radians; rho is the length of the radius vector specified in
265       dataspace units. Note that negative rho values cause the corresponding curve points
266       to be reflected across the origin.
267     </para>
268   </refsection>
269   <refsection>
270     <title>Example 1</title>
271     <programlisting role="example1"><![CDATA[ 
272 t= 0:.01:2*%pi;
273 clf();polarplot(sin(7*t),cos(8*t))
274
275 clf();polarplot([sin(7*t') sin(6*t')],[cos(8*t') cos(8*t')],[1,2])
276  ]]></programlisting>
277   </refsection>
278   <refsection>
279     <title>Example 2</title>
280     <programlisting role="example2"><![CDATA[ 
281 t= 0:.01:2*%pi;
282
283 clf();polarplot([sin(7*t') sin(6*t')],[cos(8*t') cos(8*t')],[1,2])
284  ]]></programlisting>
285   </refsection>
286   <refsection>
287     <title>Example 3</title>
288     <programlisting role="example3"><![CDATA[ 
289 t = 0:0.01:2*%pi;
290
291 polarplot(t, -1 + sin(t));
292
293  ]]></programlisting>
294   </refsection>
295 </refentry>