~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to man/graphics/plot2d.cat

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
plot2d            Scilab Group            Scilab Function            plot2d
 
2
NAME
 
3
   plot2d - 2D plot
 
4
  
 
5
CALLING SEQUENCE
 
6
 plot2d([x],y)
 
7
 plot2d([x],y,<opt_args>)
 
8
 plot2d([logflag],x,y,[style,strf,leg,rect,nax])
 
9
PARAMETERS
 
10
 x,y         : two matrices or vectors.
 
11
             
 
12
            -  If y is a vector, x must be a vector with the same size. If
 
13
               x is not given, it is supposed to be the vector 1:<size of
 
14
               y>.
 
15
               
 
16
            -  If y is a matrix, x can be:
 
17
               
 
18
              +    a vector with size equal to the row dimension of y
 
19
                   (each column of y is plotted with respect to x)
 
20
                   
 
21
              +    a matrix with the same dimensions as y (each column of
 
22
                   y is plotted with respect to the corresponding column of
 
23
                   x)
 
24
                   
 
25
              +    If x is not given, it is supposed to be the vector 
 
26
                   1:<row dimension of y>
 
27
                   
 
28
 <opt_args>  : This represents a sequence of statements key1=value1,
 
29
             key2=value2,... where key1, key2,... can be one of the
 
30
             following:
 
31
             
 
32
            style     : sets the style for each curve, see below for
 
33
                      value.
 
34
                      
 
35
            leg       : sets the curves captions. If this key is given and
 
36
                      strf is not given then x character of strf is
 
37
                      supposed to be 1. See below for value.
 
38
                      
 
39
            rect      : sets the bounds of the plot. If this key is given
 
40
                      and neither frameflag nor strf is  given then the y
 
41
                      character of strf is supposed to be 7.  See below for
 
42
                      value.
 
43
                      
 
44
            nax       : sets the grids definition. If this key is given
 
45
                      and neither axesflag nor strf is given then the z
 
46
                      character of strf is supposed to be 1.  See below for
 
47
                      value.
 
48
                      
 
49
            logflag   : sets the graduation type (linear or logarithmic)
 
50
                      along the axes. See below for value.
 
51
                      
 
52
            frameflag : specifies how the frame of the plot is computed.
 
53
                      The value is an integer ranging from 0 to 8. It
 
54
                      corresponds to the y character of strf. See below.
 
55
                      
 
56
            axesflags : specifies what kind of axes are drawn around the
 
57
                      plot. The value is an integer ranging from 0 to 5. It
 
58
                      corresponds to the z character of strf. See below.
 
59
                      
 
60
 style       : is a real row vector of size nc. The style to use for curve
 
61
             i is defined by style(i).  The default style is 1:nc (1 for
 
62
             the first curve,  2 for the second, etc.).
 
63
             
 
64
            -   if style(i) is negative or zero, the curve is plotted
 
65
                using the mark with id  abs(style(i)); use xset() to set
 
66
                the mark id and xget('mark') to get the current mark id.
 
67
                
 
68
            -   if style(i) is strictly positive, a plain line with color
 
69
                id  style(i) or a dashed line with dash id style(i) is
 
70
                used;  use xset() to see the color ids.
 
71
                
 
72
            -   When only one curve is drawn, style can be the row vector 
 
73
                of size 2 [sty,pos] where sty is used to specify the style
 
74
                and pos is an integer ranging from 1 to 6 which specifies a
 
75
                position to use for the caption.  This can be useful when a
 
76
                user wants to draw multiple curves on a plot by  calling
 
77
                the function plot2d several times and wants to give a
 
78
                caption  for each curve.
 
79
                
 
80
 strf        : is a string of length 3 "xyz".
 
81
             
 
82
            x    : controls the display of captions.
 
83
                 
 
84
                x=0   : no caption.
 
85
                      
 
86
                x=1   : captions are displayed. They are given by the
 
87
                      optional argument leg.
 
88
                      
 
89
            y    : controls the computation of the actual coordinate
 
90
                 ranges from the minimal requested values. Actual ranges
 
91
                 can be larger than minimal requirements.
 
92
                 
 
93
                
 
94
                 
 
95
                |   requirements|ranges       |ranges    |ranges       |
 
96
                |               |of a previous|given by  |computed from|
 
97
                |actual         |plot         |rect arg  |x and y      |
 
98
                |-------------- |------------ |--------- |-------------|
 
99
                |requested      |             |          |             |
 
100
                |one            |      y=0    |    y=1   |      y=2    |
 
101
                |-------------- |------------ |--------- |-------------|
 
102
                |Computed       |             |          |             |
 
103
                |for isometric  |             |    y=3   |      y=4    |
 
104
                |view           |             |          |             |
 
105
                |-------------- |------------ |--------- |-------------|
 
106
                |Enlarged       |             |          |             |
 
107
                |For pretty     |             |    y=5   |      y=6    |
 
108
                |axes           |             |          |             |
 
109
                |-------------- |------------ |--------- |-------------|
 
110
                |Previous and   |             |          |             |
 
111
                |current        |             |    y=7   |      y=8    |
 
112
                |plots merged   |             |          |             |
 
113
                |-------------- |------------ |--------- |-------------|
 
114
                |               |             |          |             |
 
115
                
 
116
                 
 
117
                
 
118
                 
 
119
            z    : controls the display of information on the frame around
 
120
                 the plot. If axes are requested, the number of tics can be
 
121
                 specified by the nax optional argument.
 
122
                 
 
123
                z=0   :  nothing is drawn around the plot.
 
124
                      
 
125
                z=1   :  axes are drawn, the y=axis is displayed on the
 
126
                      left. 
 
127
                      
 
128
                z=2   :  the plot is surrounded by a box without tics.
 
129
                      
 
130
                z=3   :  axes are drawn, the y=axis is displayed on the
 
131
                      right. 
 
132
                      
 
133
                z=4   :  axes are drawn centred in the middle of the frame
 
134
                      box. 
 
135
                      
 
136
                z=5   :  axes are drawn so as to cross at point (0,0).  If
 
137
                      point (0,0) does not lie inside the frame, axes will
 
138
                      not appear on the graph.
 
139
                      
 
140
 leg         :  a string. It is used when the first character x of
 
141
             argument strf is 1. leg has the form "leg1@leg2@...." where
 
142
             leg1, leg2,  etc. are respectively the captions of the first
 
143
             curve, of the second curve, etc.  The default is " ".
 
144
             
 
145
 rect        :  This argument is used when the second character y of
 
146
             argument strf is 1, 3 or 5. It is a row vector of size 4 and
 
147
             gives the dimension of the frame:  rect=[xmin,ymin,xmax,ymax].
 
148
             
 
149
 nax         :  This argument is used when the third character z of
 
150
             argument strf is 1. It is a row vector with four entries
 
151
             [nx,Nx,ny,Ny] where nx (ny) is the number of subgraduations on
 
152
             the x (y) axis and Nx (Ny) is the number of graduations on the
 
153
             x (y) axis.
 
154
             
 
155
 logflag     :  a string formed by to characters h (for horizontal axis)
 
156
             and v (for vertical axis) each of these characters can take
 
157
             the values "n" or "l". "l" stands for logarithmic graduation
 
158
             and "n" for normal graduation. For example "ll"stands for a
 
159
             log-log plot. Default value is "nn".
 
160
             
 
161
DESCRIPTION
 
162
   plot2d plots a set of 2D curves. Piecewise linear plotting is used.  By
 
163
  default, successive plots are superposed. To clear the previous plot, 
 
164
  use xbasc().  See the meaning of the parameters above for a complete
 
165
  description.  Enter the command plot2d() to see a demo.  Other high level
 
166
  plot2d function exist:
 
167
  
 
168
 plot2d2  : same as plot2d but the curve is supposed to be  piecewise
 
169
          constant.
 
170
          
 
171
 plot2d3  : same as plot2d but the curve is plotted with vertical bars.
 
172
          
 
173
 plot2d4  : same as plot2d but the curve is plotted with arrows.
 
174
          
 
175
EXAMPLE
 
176
 //simple plot
 
177
 x=[0:0.1:2*%pi]';
 
178
 plot2d(sin(x))
 
179
 xbasc()
 
180
 plot2d(x,sin(x))
 
181
 //multiple plot
 
182
 xbasc()
 
183
 plot2d(x,[sin(x) sin(2*x) sin(3*x)])
 
184
 // multiple plot giving the dimensions of the frame
 
185
 //   old syntax and new syntax
 
186
 xbasc()
 
187
 plot2d(x,[sin(x) sin(2*x) sin(3*x)],1:3,"011"," ",[0,0,6,0.5])
 
188
 xbasc()
 
189
 plot2d(x,[sin(x) sin(2*x) sin(3*x)],rect=[0,0,6,0.5])
 
190
 //multiple plot with captions and given tics
 
191
 //   old syntax and new syntax
 
192
 xbasc()
 
193
 plot2d(x,[sin(x) sin(2*x) sin(3*x)],..
 
194
   [1,2,3],"111","L1@L2@L3",[0,-2,2*%pi,2],[2,10,2,10])
 
195
 xbasc()
 
196
 plot2d(x,[sin(x) sin(2*x) sin(3*x)],..
 
197
   [1,2,3],leg="L1@L2@L3",nax=[2,10,2,10],rect=[0,-2,2*%pi,2])
 
198
 // isoview
 
199
 xbasc()
 
200
 plot2d(x,sin(x),1,"041")
 
201
 // scale 
 
202
 xbasc()
 
203
 plot2d(x,sin(x),1,"061") 
 
204
 // auto scaling with previous plots 
 
205
 xbasc()
 
206
 plot2d(x,sin(x),1)
 
207
 plot2d(x,2*sin(x),2)
 
208
 plot2d(2*x,cos(x),3)
 
209
 // axis on the right 
 
210
 xbasc()
 
211
 plot2d(x,sin(x),1,"183","sin(x)")
 
212
 // centered axis
 
213
 xbasc()
 
214
 plot2d(x,sin(x),1,"184","sin(x)")
 
215
 // axis centered at (0,0)
 
216
 xbasc()
 
217
 plot2d(x-4,sin(x),1,"185","sin(x)")
 
218
SEE ALSO
 
219
   plot2d1, plot2d2, plot2d3, plot2d4, xbasc, xset
 
220
  
 
221
AUTHOR
 
222
   J.Ph.C.
 
223