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