e9f0a653e44b7bd3aace9f0164272bed9e2456fc
[scilab.git] / scilab / modules / graphics / help / en_US / 2d_plot / plot2d.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  * Copyright (C) 2009 - DIGITEO - Pierre Lando
6  * Copyright (C) 2010 - DIGITEO - Yann Collette
7  *
8  * Copyright (C) 2012 - 2016 - Scilab Enterprises
9  *
10  * This file is hereby licensed under the terms of the GNU GPL v2.0,
11  * pursuant to article 5.3.4 of the CeCILL v.2.1.
12  * This file was originally licensed under the terms of the CeCILL v2.1,
13  * and continues to be available under such terms.
14  * For more information, see the COPYING file which you should have received
15  * along with this program.
16  *
17  -->
18 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:id="plot2d" xml:lang="en">
19     <refnamediv>
20         <refname>plot2d</refname>
21         <refpurpose>2D plot</refpurpose>
22     </refnamediv>
23     <refsynopsisdiv>
24         <title>Syntax</title>
25         <synopsis>
26             plot2d([logflag,][x,],y[,style[,strf[,leg[,rect[,nax]]]]])
27             plot2d([logflag,][x,],y,&lt;opt_args&gt;)
28         </synopsis>
29     </refsynopsisdiv>
30     <refsection>
31         <title>Arguments</title>
32         <variablelist>
33             <varlistentry>
34                 <term>x</term>
35                 <listitem>
36                     <para>a real matrix or vector. If omitted, it is assumed to be the
37                         vector <literal>1:n</literal> where <literal>n</literal> is the
38                         number of curve points given by the <literal>y</literal>
39                         parameter.
40                     </para>
41                 </listitem>
42             </varlistentry>
43             <varlistentry>
44                 <term>y</term>
45                 <listitem>
46                     <para>a real matrix or vector.</para>
47                 </listitem>
48             </varlistentry>
49             <varlistentry>
50                 <term>&lt;opt_args&gt;</term>
51                 <listitem>
52                     <para>This represents a sequence of statements
53                         <literal>key1=value1,key2=value2</literal>,... where
54                         <literal>key1</literal>, <literal>key2,...</literal> can be one of
55                         the following:
56                     </para>
57                     <variablelist>
58                         <varlistentry>
59                             <term>logflag</term>
60                             <listitem>
61                                 <para>sets the scale (linear or logarithmic) along the axes.
62                                     The associated value should be a string with possible
63                                     values: <literal>"nn"</literal>, <literal>"nl"</literal> ,
64                                     <literal>"ln"</literal> and <literal>"ll"</literal> .
65                                 </para>
66                             </listitem>
67                         </varlistentry>
68                         <varlistentry>
69                             <term>style</term>
70                             <listitem>
71                                 <para>sets the style for each curve. The associated value
72                                     should be a real vector with integer (positive or negative)
73                                     values.
74                                 </para>
75                             </listitem>
76                         </varlistentry>
77                         <varlistentry>
78                             <term>strf</term>
79                             <listitem>
80                                 <para>controls the display of captions.</para>
81                                 <para>
82                                     <literal>strf</literal> is a string of length 3 
83                                     <literal>"xyz"</literal> (by default <literal>strf=
84                                         "081"
85                                     </literal>
86                                     )
87                                 </para>
88                             </listitem>
89                         </varlistentry>
90                         <varlistentry>
91                             <term>leg</term>
92                             <listitem>
93                                 <para>sets the curves captions. The associated value should be
94                                     a character string.
95                                 </para>
96                             </listitem>
97                         </varlistentry>
98                         <varlistentry>
99                             <term>rect</term>
100                             <listitem>
101                                 <para>sets the minimal bounds requested for the plot. The
102                                     associated value should be a real vector with four entries:
103                                     <literal>[xmin,ymin,xmax,ymax]</literal>.
104                                 </para>
105                             </listitem>
106                         </varlistentry>
107                         <varlistentry>
108                             <term>nax</term>
109                             <listitem>
110                                 <para>sets the axes labels and tics definition. The associated
111                                     value should be a real vector with four integer entries
112                                     <literal>[nx,Nx,ny,Ny].</literal>
113                                 </para>
114                             </listitem>
115                         </varlistentry>
116                         <varlistentry>
117                             <term>frameflag</term>
118                             <listitem>
119                                 <para>controls the computation of the actual coordinate ranges
120                                     from the minimal requested values. The associated value should
121                                     be an integer ranging from 0 to 8.
122                                 </para>
123                             </listitem>
124                         </varlistentry>
125                         <varlistentry>
126                             <term>axesflag</term>
127                             <listitem>
128                                 <para>specifies how the axes are drawn. The associated value
129                                     should be an integer ranging from 0 to 5 or 9 (default value).
130                                 </para>
131                             </listitem>
132                         </varlistentry>
133                     </variablelist>
134                 </listitem>
135             </varlistentry>
136         </variablelist>
137     </refsection>
138     <refsection>
139         <title>Description</title>
140         <para>
141             <literal>plot2d</literal> plots a set of 2D curves. If you are
142             familiar with Matlab <literal>plot</literal> syntax, you should use <link linkend="plot">plot</link>.
143         </para>
144         <para>
145             If <literal>x</literal> and <literal>y</literal> are vectors,
146             plot2d(x,y,&lt;opt_args&gt;) plots vector <literal>y</literal> versus
147             vector <literal>x</literal>. <literal>x</literal> and <literal>y</literal>
148             vectors should have the same number of entries.
149         </para>
150         <para>
151             If <literal>x</literal> is a vector and <literal>y</literal> a
152             matrix plot2d(x,y,&lt;opt_args&gt;) plots each columns of
153             <literal>y</literal> versus vector <literal>x</literal>. In this case the
154             number of columns of <literal>y</literal> should be equal to the number of
155             <literal>x</literal> entries.
156         </para>
157         <para>
158             If <literal>x</literal> and <literal>y</literal> are matrices,
159             plot2d(x,y,&lt;opt_args&gt;) plots each columns of <literal>y</literal>
160             versus corresponding column of <literal>x</literal>. In this case the
161             <literal>x</literal> and <literal>y</literal> sizes should be the
162             same.
163         </para>
164         <para>
165             If <literal>y</literal> is a vector, plot2d(y,&lt;opt_args&gt;)
166             plots vector <literal>y</literal> versus vector
167             <literal>1:size(y,'*')</literal>.
168         </para>
169         <para>
170             If <literal>y</literal> is a matrix, plot2d(y,&lt;opt_args&gt;)
171             plots each columns of <literal>y</literal> versus vector
172             <literal>1:size(y,1)</literal>.
173         </para>
174         <para>
175             The <literal>&lt;opt_args&gt;</literal> arguments should be used to
176             customize the plot
177         </para>
178         <variablelist>
179             <varlistentry>
180                 <term>logflag</term>
181                 <listitem>
182                     <para>This option may be used to set the scale (linear or
183                         logarithmic) along the axes. The associated value should be a
184                         string with possible values: <literal>"nn"</literal>,
185                         <literal>"nl"</literal> , <literal>"ln"</literal> and
186                         <literal>"ll"</literal>. <literal>"l"</literal> stands for
187                         logarithmic scale and graduations and <literal>"n"</literal> for
188                         normal scale.
189                     </para>
190                 </listitem>
191             </varlistentry>
192             <varlistentry>
193                 <term>style</term>
194                 <listitem>
195                     <para>This option may be used to specify how the curves are drawn.
196                         If this option is specified, the associated value should be a vector
197                         with as many entries as curves.
198                     </para>
199                     <itemizedlist>
200                         <listitem>
201                             <para>
202                                 if <literal>style(i)</literal> is strictly positive, the
203                                 curve is drawn as plain line and <literal>style(i)</literal>
204                                 defines the index of the color used to draw the curve (see <link linkend="getcolor">getcolor</link>). Note that the line style
205                                 and the thickness can be set through the polyline entity
206                                 properties (see <link linkend="polyline_properties">polyline_properties</link>).
207                             </para>
208                             <para>Piecewise linear interpolation is done between the given
209                                 curve points.
210                             </para>
211                         </listitem>
212                         <listitem>
213                             <para>
214                                 if <literal>style(i)</literal> is negative or zero, the
215                                 given curve points are drawn using marks,
216                                 <literal>abs(style(i))</literal> defines the mark with id used.
217                                 Note that the marks color and marks sizes can be set through
218                                 the polyline entity properties (see <link linkend="polyline_properties">polyline_properties</link>).
219                             </para>
220                         </listitem>
221                     </itemizedlist>
222                 </listitem>
223             </varlistentry>
224             <varlistentry>
225                 <term>strf</term>
226                 <listitem>
227                     <para>
228                         is a string of length 3 <literal>"xyz"</literal> (by default
229                         <literal>strf= "081"</literal>)
230                     </para>
231                     <variablelist>
232                         <varlistentry>
233                             <term>x</term>
234                             <listitem>
235                                 <para>controls the display of captions.</para>
236                                 <variablelist>
237                                     <varlistentry>
238                                         <term>x=0</term>
239                                         <listitem>
240                                             <para>no caption.</para>
241                                         </listitem>
242                                     </varlistentry>
243                                     <varlistentry>
244                                         <term>x=1</term>
245                                         <listitem>
246                                             <para>captions are displayed. They are given by the
247                                                 optional argument <literal>leg</literal>.
248                                             </para>
249                                         </listitem>
250                                     </varlistentry>
251                                 </variablelist>
252                             </listitem>
253                         </varlistentry>
254                         <varlistentry>
255                             <term>y</term>
256                             <listitem>
257                                 <para>controls the computation of the actual coordinate ranges
258                                     from the minimal requested values. Actual ranges can be larger
259                                     than minimal requirements.
260                                 </para>
261                                 <variablelist>
262                                     <varlistentry>
263                                         <term>y=0</term>
264                                         <listitem>
265                                             <para>no computation, the plot use the previous (or
266                                                 default) scale
267                                             </para>
268                                         </listitem>
269                                     </varlistentry>
270                                     <varlistentry>
271                                         <term>y=1</term>
272                                         <listitem>
273                                             <para>from the rect arg</para>
274                                         </listitem>
275                                     </varlistentry>
276                                     <varlistentry>
277                                         <term>y=2</term>
278                                         <listitem>
279                                             <para>from the min/max of the x, y data</para>
280                                         </listitem>
281                                     </varlistentry>
282                                     <varlistentry>
283                                         <term>y=3</term>
284                                         <listitem>
285                                             <para>built for an isometric scale from the rect
286                                                 arg
287                                             </para>
288                                         </listitem>
289                                     </varlistentry>
290                                     <varlistentry>
291                                         <term>y=4</term>
292                                         <listitem>
293                                             <para>built for an isometric plot from the min/max of
294                                                 the x, y data
295                                             </para>
296                                         </listitem>
297                                     </varlistentry>
298                                     <varlistentry>
299                                         <term>y=5</term>
300                                         <listitem>
301                                             <para>enlarged for pretty axes from the rect arg</para>
302                                         </listitem>
303                                     </varlistentry>
304                                     <varlistentry>
305                                         <term>y=6</term>
306                                         <listitem>
307                                             <para>enlarged for pretty axes from the min/max of the
308                                                 x, y data
309                                             </para>
310                                         </listitem>
311                                     </varlistentry>
312                                     <varlistentry>
313                                         <term>y=7</term>
314                                         <listitem>
315                                             <para>like y=1 but the previous plot(s) are redrawn to
316                                                 use the new scale
317                                             </para>
318                                         </listitem>
319                                     </varlistentry>
320                                     <varlistentry>
321                                         <term>y=8</term>
322                                         <listitem>
323                                             <para>like y=2 but the previous plot(s) are redrawn to
324                                                 use the new scale
325                                             </para>
326                                         </listitem>
327                                     </varlistentry>
328                                 </variablelist>
329                             </listitem>
330                         </varlistentry>
331                         <varlistentry>
332                             <term>z</term>
333                             <listitem>
334                                 <para>controls the display of information on the frame around
335                                     the plot. If axes are requested, the number of tics can be
336                                     specified by the <literal>nax</literal> optional
337                                     argument.
338                                 </para>
339                                 <variablelist>
340                                     <varlistentry>
341                                         <term>z=0</term>
342                                         <listitem>
343                                             <para>nothing is drawn around the plot.</para>
344                                         </listitem>
345                                     </varlistentry>
346                                     <varlistentry>
347                                         <term>z=1</term>
348                                         <listitem>
349                                             <para>axes are drawn, the y=axis is displayed on the
350                                                 left.
351                                             </para>
352                                         </listitem>
353                                     </varlistentry>
354                                     <varlistentry>
355                                         <term>z=2</term>
356                                         <listitem>
357                                             <para>the plot is surrounded by a box without
358                                                 tics.
359                                             </para>
360                                         </listitem>
361                                     </varlistentry>
362                                     <varlistentry>
363                                         <term>z=3</term>
364                                         <listitem>
365                                             <para>axes are drawn, the y=axis is displayed on the
366                                                 right.
367                                             </para>
368                                         </listitem>
369                                     </varlistentry>
370                                     <varlistentry>
371                                         <term>z=4</term>
372                                         <listitem>
373                                             <para>axes are drawn centred in the middle of the frame
374                                                 box.
375                                             </para>
376                                         </listitem>
377                                     </varlistentry>
378                                     <varlistentry>
379                                         <term>z=5</term>
380                                         <listitem>
381                                             <para>axes are drawn so as to cross at point
382                                                 <literal>(0,0)</literal>. If point
383                                                 <literal>(0,0)</literal> does not lie inside the frame,
384                                                 axes will not appear on the graph.
385                                             </para>
386                                         </listitem>
387                                     </varlistentry>
388                                 </variablelist>
389                             </listitem>
390                         </varlistentry>
391                     </variablelist>
392                 </listitem>
393             </varlistentry>
394             <varlistentry>
395                 <term>leg</term>
396                 <listitem>
397                     <para>This option may be used to sets the curve captions. It must be
398                         a string with the form <literal>"leg1@leg2@...."</literal> where
399                         <literal>leg1</literal> , <literal>leg2</literal> , etc. are
400                         respectively the captions of the first curve, of the second curve,
401                         etc. The default is <literal> " "</literal>.
402                     </para>
403                     <para>The curve captions are drawn on below the x-axis. This option
404                         is not flexible enough, use the <link linkend="captions">captions</link> or <link linkend="legend">legend</link> functions preferably.
405                     </para>
406                 </listitem>
407             </varlistentry>
408             <varlistentry>
409                 <term>rect</term>
410                 <listitem>
411                     <para>This option may be used to set the minimal bounds requested
412                         for the plot. If this option is specified, the associated value
413                         should be a real vector with four entries:
414                     </para>
415                     <para>
416                         <literal>[xmin,ymin,xmax,ymax]</literal>.
417                         <literal>xmin</literal> and <literal>xmax</literal> defines the
418                         bounds on the abscissae while <literal>ymin</literal> and
419                         <literal>ymax</literal> defines the bounds on the ordinates.
420                     </para>
421                     <para>This argument may be used together with the
422                         <literal>frameflag</literal> option to specify how the axes
423                         boundaries are derived from the given <literal>rect</literal>
424                         argument. If the <literal>frameflag</literal> option is not given,
425                         it is supposed to be <literal>frameflag=7</literal>.
426                     </para>
427                     <para>The axes boundaries can also be customized through the axes
428                         entity properties (see <link linkend="axes_properties">axes_properties</link>).
429                     </para>
430                 </listitem>
431             </varlistentry>
432             <varlistentry>
433                 <term>nax</term>
434                 <listitem>
435                     <para>This option may be used to specify the axes labels and tics
436                         definition. The associated value should be a real vector with four integer entries
437                         <literal>[nx,Nx,ny,Ny]</literal>.
438                     </para>
439                     <para>
440                         <literal>Nx</literal> gives the number of main tics to be used
441                         on the x-axis (to use autoticks set it to -1), <literal>nx</literal> gives the number of
442                         subtics to be drawn between two main x-axis tics.
443                     </para>
444                     <para>
445                         <literal>Ny</literal> and <literal>ny</literal> give similar
446                         information for the y-axis.
447                     </para>
448                     <para>
449                         If <literal>axesflag</literal> option is not set
450                         <literal>nax</literal> option supposes that
451                         <literal>axesflag</literal> option has been set to 9.
452                     </para>
453                 </listitem>
454             </varlistentry>
455             <varlistentry>
456                 <term>frameflag</term>
457                 <listitem>
458                     <para>This option may be used to control the computation of the
459                         actual coordinate ranges from the minimal requested values. Actual
460                         ranges can be larger than minimal requirements.
461                     </para>
462                     <variablelist>
463                         <varlistentry>
464                             <term>frameflag=0</term>
465                             <listitem>
466                                 <para>no computation, the plot use the previous (or default)
467                                     scale.
468                                 </para>
469                             </listitem>
470                         </varlistentry>
471                         <varlistentry>
472                             <term>frameflag=1</term>
473                             <listitem>
474                                 <para>The actual range is the range given by the
475                                     <literal>rect</literal> option.
476                                 </para>
477                             </listitem>
478                         </varlistentry>
479                         <varlistentry>
480                             <term>frameflag=2</term>
481                             <listitem>
482                                 <para>The actual range is computed from the min/max of the
483                                     <literal>x</literal> and <literal>y</literal> data.
484                                 </para>
485                             </listitem>
486                         </varlistentry>
487                         <varlistentry>
488                             <term>frameflag=3</term>
489                             <listitem>
490                                 <para>The actual range is the range given by the
491                                     <literal>rect</literal> option and enlarged to get an
492                                     isometric scale.
493                                 </para>
494                             </listitem>
495                         </varlistentry>
496                         <varlistentry>
497                             <term>frameflag=4</term>
498                             <listitem>
499                                 <para>The actual range is computed from the min/max of the
500                                     <literal>x</literal> and <literal>y</literal> data and
501                                     enlarged to get an isometric scale.
502                                 </para>
503                             </listitem>
504                         </varlistentry>
505                         <varlistentry>
506                             <term>frameflag=5</term>
507                             <listitem>
508                                 <para>The actual range is the range given by the
509                                     <literal>rect</literal> option and enlarged to get pretty axes
510                                     labels.
511                                 </para>
512                             </listitem>
513                         </varlistentry>
514                         <varlistentry>
515                             <term>frameflag=6</term>
516                             <listitem>
517                                 <para>The actual range is computed from the min/max of the
518                                     <literal>x</literal> and <literal>y</literal> data and
519                                     enlarged to get pretty axes labels.
520                                 </para>
521                             </listitem>
522                         </varlistentry>
523                         <varlistentry>
524                             <term>frameflag=7</term>
525                             <listitem>
526                                 <para>
527                                     like <literal>frameflag=1</literal> but the previous
528                                     plot(s) are redrawn to use the new scale. Used to add the
529                                     current graph to a previous one.
530                                 </para>
531                             </listitem>
532                         </varlistentry>
533                         <varlistentry>
534                             <term>frameflag=8</term>
535                             <listitem>
536                                 <para>
537                                     like<literal>frameflag=2</literal> but the previous
538                                     plot(s) are redrawn to use the new scale. Used to add the
539                                     current graph to a previous one.
540                                 </para>
541                             </listitem>
542                         </varlistentry>
543                         <varlistentry>
544                             <term>frameflag=9</term>
545                             <listitem>
546                                 <para>
547                                     like<literal>frameflag=8</literal> but the range is
548                                     enlarged to get pretty axes labels. This is the default
549                                     value.
550                                 </para>
551                             </listitem>
552                         </varlistentry>
553                     </variablelist>
554                     <para>The axes boundaries can also be customized through the axes
555                         entity properties (see <link linkend="axes_properties">axes_properties</link>)
556                     </para>
557                 </listitem>
558             </varlistentry>
559             <varlistentry>
560                 <term>axesflag</term>
561                 <listitem>
562                     <para>This option may be used to specify how the axes are drawn. The
563                         associated value should be an integer ranging from 0 to 5 :
564                     </para>
565                     <variablelist>
566                         <varlistentry>
567                             <term>axesflag=0</term>
568                             <listitem>
569                                 <para>nothing is drawn around the plot (axes_visible=["off"
570                                     "off"];box="off").
571                                 </para>
572                             </listitem>
573                         </varlistentry>
574                         <varlistentry>
575                             <term>axesflag=1</term>
576                             <listitem>
577                                 <para>axes are drawn, the y-axis is displayed on the left
578                                     (axes_visible=["on" "on"];box="on",y_location="left").
579                                 </para>
580                             </listitem>
581                         </varlistentry>
582                         <varlistentry>
583                             <term>axesflag=2</term>
584                             <listitem>
585                                 <para>the plot is surrounded by a box without tics
586                                     (axes_visible=["off" "off"];box="on").
587                                 </para>
588                             </listitem>
589                         </varlistentry>
590                         <varlistentry>
591                             <term>axesflag=3</term>
592                             <listitem>
593                                 <para>axes are drawn, the y-axis is displayed on the
594                                     right (axes_visible=["on"
595                                     "on"];box="off",y_location="right").
596                                 </para>
597                             </listitem>
598                         </varlistentry>
599                         <varlistentry>
600                             <term>axesflag=4</term>
601                             <listitem>
602                                 <para>axes are drawn centered in the middle of the frame, the box
603                                     being not drawn (axes_visible=["on" "on"];box="off",x_location="middle",
604                                     y_location="middle").
605                                 </para>
606                             </listitem>
607                         </varlistentry>
608                         <varlistentry>
609                             <term>axesflag=5</term>
610                             <listitem>
611                                 <para>axes are drawn centered in the middle of the frame similarly to
612                                     <literal>axesflag=4</literal>, the difference being that the box is drawn
613                                     (axes_visible=["on" "on"];box="on",x_location="middle",y_location="middle").
614                                 </para>
615                             </listitem>
616                         </varlistentry>
617                         <varlistentry>
618                             <term>axesflag=9</term>
619                             <listitem>
620                                 <para>axes are drawn, the y-axis is displayed on the left
621                                     (axes_visible=["on" "on"];box="off",y_location="left"). This
622                                     is the default value.
623                                 </para>
624                             </listitem>
625                         </varlistentry>
626                     </variablelist>
627                     <para>The axes aspect can also be customized through the axes
628                         entity properties (see <link linkend="axes_properties">axes_properties</link>).
629                     </para>
630                 </listitem>
631             </varlistentry>
632         </variablelist>
633     </refsection>
634     <refsection>
635         <title>More information</title>
636         <para>By default, successive plots are superposed. To clear the previous
637             plot, use 
638             <literal>
639                 <link linkend="clf">clf()</link>
640             </literal>
641             .
642         </para>
643         <para>
644             Enter the command <literal>plot2d()</literal> to see a demo.
645         </para>
646         <para>Other high level plot2d functions exist:</para>
647         <itemizedlist>
648             <listitem>
649                 <para>
650                     plot2d2 same as <literal>plot2d</literal> but the curve is
651                     supposed to be piecewise constant.
652                 </para>
653             </listitem>
654             <listitem>
655                 <para>
656                     plot2d3 same as <literal>plot2d</literal> but the curve is
657                     plotted with vertical bars.
658                 </para>
659             </listitem>
660             <listitem>
661                 <para>
662                     plot2d4 same as <literal>plot2d</literal> but the curve is
663                     plotted with vertical arrows.
664                 </para>
665             </listitem>
666         </itemizedlist>
667     </refsection>
668     <refsection>
669         <title>Examples</title>
670         <programlisting role="example"><![CDATA[ 
671 // x initialisation 
672 x=[0:0.1:2*%pi]';
673 //simple plot
674 plot2d(sin(x));
675  ]]></programlisting>
676         <scilab:image>
677             x=[0:0.1:2*%pi]';
678             plot2d(sin(x));
679         </scilab:image>
680         <programlisting role="example"><![CDATA[ 
681 clf();
682 x=[0:0.1:2*%pi]';
683 plot2d(x,sin(x));
684 //multiple plot
685  ]]></programlisting>
686         <scilab:image>
687             x=[0:0.1:2*%pi]';
688             plot2d(x,sin(x));
689         </scilab:image>
690         <programlisting role="example"><![CDATA[ 
691 clf();
692 x=[0:0.1:2*%pi]';
693 plot2d(x,[sin(x) sin(2*x) sin(3*x)])
694  ]]></programlisting>
695         <scilab:image>
696             x=[0:0.1:2*%pi]';
697             plot2d(x,[sin(x) sin(2*x) sin(3*x)])
698         </scilab:image>
699         <programlisting role="example"><![CDATA[ 
700 // multiple plot giving the dimensions of the frame
701 clf();
702 x=[0:0.1:2*%pi]';
703 plot2d(x,[sin(x) sin(2*x) sin(3*x)],rect=[0,0,6,0.5]);
704  ]]></programlisting>
705         <scilab:image>
706             x=[0:0.1:2*%pi]';
707             plot2d(x,[sin(x) sin(2*x) sin(3*x)],rect=[0,0,6,0.5]);
708         </scilab:image>
709         <programlisting role="example"><![CDATA[ 
710 //multiple plot with captions and given tics + style
711 clf();
712 x=[0:0.1:2*%pi]';
713 plot2d(x,[sin(x) sin(2*x) sin(3*x)],..
714        [1,2,3],leg="L1@L2@L3",nax=[2,10,2,10],rect=[0,-2,2*%pi,2]);
715  ]]></programlisting>
716         <scilab:image>
717             x=[0:0.1:2*%pi]';
718             plot2d(x,[sin(x) sin(2*x) sin(3*x)],..
719             [1,2,3],leg="L1@L2@L3",nax=[2,10,2,10],rect=[0,-2,2*%pi,2]);
720         </scilab:image>
721         <programlisting role="example"><![CDATA[ 
722 // isoview
723 clf();
724 x=[0:0.1:2*%pi]';
725 plot2d(x,sin(x),1,frameflag= 4);
726  ]]></programlisting>
727         <scilab:image>
728             x=[0:0.1:2*%pi]';
729             plot2d(x,sin(x),1,frameflag= 4);
730         </scilab:image>
731         <programlisting role="example"><![CDATA[ 
732 // scale 
733 clf();
734 x=[0:0.1:2*%pi]';
735 plot2d(x,sin(x),1,frameflag= 6);
736  ]]></programlisting>
737         <scilab:image>
738             x=[0:0.1:2*%pi]';
739             plot2d(x,sin(x),1,frameflag= 6);
740         </scilab:image>
741         <programlisting role="example"><![CDATA[ 
742 // auto scaling with previous plots + style
743 clf();
744 x=[0:0.1:2*%pi]';
745 plot2d(x,sin(x),-1);
746 plot2d(x,2*sin(x),12); 
747 plot2d(2*x,cos(x),3);
748  ]]></programlisting>
749         <scilab:image>
750             x=[0:0.1:2*%pi]';
751             plot2d(x,sin(x),-1);
752             plot2d(x,2*sin(x),12); 
753             plot2d(2*x,cos(x),3);
754         </scilab:image>
755         <programlisting role="example"><![CDATA[ 
756 // axis on the right 
757 clf();
758 x=[0:0.1:2*%pi]';
759 plot2d(x,sin(x),leg="sin(x)");
760 a=gca(); // Handle on axes entity 
761 a.y_location ="right"; 
762  ]]></programlisting>
763         <scilab:image>
764             x=[0:0.1:2*%pi]';
765             plot2d(x,sin(x),leg="sin(x)");
766             a=gca(); // Handle on axes entity 
767             a.y_location ="right"; 
768         </scilab:image>
769         <programlisting role="example"><![CDATA[ 
770
771 // axis centered at (0,0) 
772 clf();
773 x=[0:0.1:2*%pi]';
774 plot2d(x-4,sin(x),1,leg="sin(x)");
775 a=gca(); // Handle on axes entity
776 a.x_location = "origin"; 
777 a.y_location = "origin"; 
778 // Some operations on entities created by plot2d ...
779 a=gca();
780 a.isoview='on'; 
781 a.children // list the children of the axes.
782 // There are a compound made of two polylines and a legend 
783 poly1= a.children(1).children(1); //store polyline handle into poly1 
784 poly1.foreground = 4; // another way to change the style...
785 poly1.thickness = 3;  // ...and the thickness of a curve.
786 poly1.clip_state='off'; // clipping control
787 leg = a.children(2); // store legend handle into leg
788 leg.font_style = 9; 
789 leg.line_mode = "on";
790 a.isoview='off';
791  ]]></programlisting>
792         <scilab:image>
793             
794             // axis centered at (0,0) 
795             clf();
796             x=[0:0.1:2*%pi]';
797             plot2d(x-4,sin(x),1,leg="sin(x)");
798             a=gca(); // Handle on axes entity
799             a.x_location = "origin"; 
800             a.y_location = "origin"; 
801             // Some operations on entities created by plot2d ...
802             a=gca();
803             a.isoview='on'; 
804             a.children // list the children of the axes.
805             // There are a compound made of two polylines and a legend 
806             poly1= a.children(1).children(1); //store polyline handle into poly1 
807             poly1.foreground = 4; // another way to change the style...
808             poly1.thickness = 3;  // ...and the thickness of a curve.
809             poly1.clip_state='off'; // clipping control
810             leg = a.children(2); // store legend handle into leg
811             leg.font_style = 9; 
812             leg.line_mode = "on";
813             a.isoview='off';
814         </scilab:image>
815         
816     </refsection>
817     <refsection role="see also">
818         <title>See Also</title>
819         <simplelist type="inline">
820             <member>
821                 <link linkend="plot">plot</link>
822             </member>
823             <member>
824                 <link linkend="plot2d2">plot2d2</link>
825             </member>
826             <member>
827                 <link linkend="plot2d3">plot2d3</link>
828             </member>
829             <member>
830                 <link linkend="plot2d4">plot2d4</link>
831             </member>
832             <member>
833                 <link linkend="clf">clf</link>
834             </member>
835             <member>
836                 <link linkend="xdel">xdel</link>
837             </member>
838             <member>
839                 <link linkend="delete">delete</link>
840             </member>
841         </simplelist>
842     </refsection>
843 </refentry>