plot2d_old_version — The syntaxes described below are obsolete
plot2d([logflag],x,y,[style,strf,leg,rect,nax])
two matrices (or column vectors).
in the usual way x
is a matrix of the
same size than y
(the column j of
y
is plotted with respect to column j of
x
)
if all the columns of x
are equal (ie
the abscissae of all the curves are the same),
x
may be simply the (column) vector of these
abscissae (x
is then a column vector of
length equal to the row dimension of
y
).
when x
is not given, it is supposed to
be the column vector [1; 2; ...; row dimension of y].
is a real row vector of size nc. The style to use for curve
i
is defined by style(i)
. The
default style is 1:nc
(1 for the first curve, 2
for the second, etc.).
if style(i)
is negative or zero, the
curve is plotted using the mark with id
abs(style(i))
; use xset()
to set the mark id and xget('mark') to get the current mark
id.
if style(i)
is strictly positive, a
plain line with color id style(i)
or a dashed
line with dash id style(i)
is used; use
xset()
to see the color ids.
is a string of length 3 "xyz"
(by default
strf= "081"
)
controls the display of captions.
no caption.
captions are displayed. They are given by the
optional argument leg
.
controls the computation of the actual coordinate ranges from the minimal requested values. Actual ranges can be larger than minimal requirements.
no computation, the plot use the previus (or default) scale
from the rect arg
from the min/max of the x, y datas
built for an isometric scale from the rect arg
built for an isometric plot from the min/max of the x, y datas
enlarged for pretty axes from the rect arg
enlarged for pretty axes from the min/max of the x, y datas
like y=1 but the previus plot(s) are redrawn to use the new scale
like y=2 but the previus plot(s) are redrawn to use the new scale
controls the display of information on the frame around
the plot. If axes are requested, the number of tics can be
specified by the nax
optional
argument.
nothing is drawn around the plot.
axes are drawn, the y=axis is displayed on the left.
the plot is surrounded by a box without tics.
axes are drawn, the y=axis is displayed on the right.
axes are drawn centred in the middle of the frame box.
axes are drawn so as to cross at point
(0,0)
. If point
(0,0)
does not lie inside the frame,
axes will not appear on the graph.
a string. It is used when the first character x of argument
strf
is 1. leg
has the form
"leg1@leg2@...."
where leg1
,
leg2
, etc. are respectively the captions of the
first curve, of the second curve, etc. The default is
""
.
This argument is used when the second character y of argument
strf
is 1, 3 or 5. It is a row vector of size 4
and gives the dimension of the frame:
rect=[xmin,ymin,xmax,ymax]
.
This argument is used when the third character z of argument
strf
is 1. It is a row vector with four entries
[nx,Nx,ny,Ny]
where nx
(ny
) is the number of subgraduations on the x (y)
axis and Nx
(Ny
) is the number
of graduations on the x (y) axis.
a string formed by to characters h (for horizontal axis) and v (for vertical axis) each of these characters can take the values "n" or "l". "l" stands for logarithmic graduation and "n" for normal graduation. For example "ll"stands for a log-log plot. Default value is "nn".
plot2d
plots a set of 2D curves. Piecewise linear
plotting is used.
By default, successive plots are superposed. To clear the previous
plot, use clf()
.
See the meaning of the parameters above for a complete description.
Enter the command plot2d()
to see a demo.
Other high level plot2d function exists:
//simple plot x=[0:0.1:2*%pi]'; plot2d(sin(x)) clf() plot2d(x,sin(x)) //multiple plot clf() plot2d(x,[sin(x) sin(2*x) sin(3*x)]) // multiple plot giving the dimensions of the frame // old syntax and new syntax clf() plot2d(x,[sin(x) sin(2*x) sin(3*x)],1:3,"011","",[0,0,6,0.5]) clf() plot2d(x,[sin(x) sin(2*x) sin(3*x)],rect=[0,0,6,0.5]) //multiple plot with captions and given tics // old syntax and new syntax clf() plot2d(x,[sin(x) sin(2*x) sin(3*x)],.. [1,2,3],"111","L1@L2@L3",[0,-2,2*%pi,2],[2,10,2,10]); clf() plot2d(x,[sin(x) sin(2*x) sin(3*x)],.. [1,2,3],leg="L1@L2@L3",nax=[2,10,2,10],rect=[0,-2,2*%pi,2]) // isoview clf() plot2d(x,sin(x),1,"041") // scale clf() plot2d(x,sin(x),1,"061") // auto scaling with previous plots clf() plot2d(x,sin(x),1) plot2d(x,2*sin(x),2) plot2d(2*x,cos(x),3) // axis on the right clf() plot2d(x,sin(x),1,"183","sin(x)") // centered axis clf() plot2d(x,sin(x),1,"184","sin(x)") // axis centered at (0,0) clf() plot2d(x-4,sin(x),1,"185","sin(x)")