Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
18
Добавлен:
09.02.2015
Размер:
146.43 Кб
Скачать

matlab\graph2d – Двухмерные графики

Elementary X-Y graphs

<plot> - Linear plot.

PLOT Linear plot.

PLOT(X,Y) plots vector Y versus vector X. If X or Y is a matrix,

then the vector is plotted versus the rows or columns of the matrix,

whichever line up. If X is a scalar and Y is a vector, disconnected

line objects are created and plotted as discrete points vertically at

X.

PLOT(Y) plots the columns of Y versus their index.

If Y is complex, PLOT(Y) is equivalent to PLOT(real(Y),imag(Y)).

In all other uses of PLOT, the imaginary part is ignored.

Various line types, plot symbols and colors may be obtained with

PLOT(X,Y,S) where S is a character string made from one element

from any or all the following 3 columns:

b blue . point - solid

g green o circle : dotted

r red x x-mark -. dashdot

c cyan + plus -- dashed

m magenta * star (none) no line

y yellow s square

k black d diamond

w white v triangle (down)

^ triangle (up)

< triangle (left)

> triangle (right)

p pentagram

h hexagram

For example, PLOT(X,Y,'c+:') plots a cyan dotted line with a plus

at each data point; PLOT(X,Y,'bd') plots blue diamond at each data

point but does not draw any line.

PLOT(X1,Y1,S1,X2,Y2,S2,X3,Y3,S3,...) combines the plots defined by

the (X,Y,S) triples, where the X's and Y's are vectors or matrices

and the S's are strings.

For example, PLOT(X,Y,'y-',X,Y,'go') plots the data twice, with a

solid yellow line interpolating green circles at the data points.

The PLOT command, if no color is specified, makes automatic use of

the colors specified by the axes ColorOrder property. By default,

PLOT cycles through the colors in the ColorOrder property. For

monochrome systems, PLOT cycles over the axes LineStyleOrder property.

Note that RGB colors in the ColorOrder property may differ from

similarly-named colors in the (X,Y,S) triples. For example, the

second axes ColorOrder property is medium green with RGB [0 .5 0],

while PLOT(X,Y,'g') plots a green line with RGB [0 1 0].

If you do not specify a marker type, PLOT uses no marker.

If you do not specify a line style, PLOT uses a solid line.

PLOT(AX,...) plots into the axes with handle AX.

PLOT returns a column vector of handles to lineseries objects, one

handle per plotted line.

The X,Y pairs, or X,Y,S triples, can be followed by

parameter/value pairs to specify additional properties

of the lines. For example, PLOT(X,Y,'LineWidth',2,'Color',[.6 0 0])

will create a plot with a dark red line width of 2 points.

Example

x = -pi:pi/10:pi;

y = tan(sin(x)) - sin(tan(x));

plot(x,y,'--rs','LineWidth',2,...

'MarkerEdgeColor','k',...

'MarkerFaceColor','g',...

'MarkerSize',10)

See also plottools, semilogx, semilogy, loglog, plotyy, plot3, grid,

title, xlabel, ylabel, axis, axes, hold, legend, subplot, scatter.

Overloaded methods:

timeseries/plot

phytree/plot

clustergram/plot

HeatMap/plot

channel.plot

sfit/plot

cfit/plot

fints/plot

idmodel/plot

idfrd/plot

iddata/plot

idnlhw/plot

idnlarx/plot

cgrules/plot

xregtwostage/plot

xregtransient/plot

xregmodel/plot

xregarx/plot

localmulti/plot

localmod/plot

localavfit/plot

sweepset/plot

mdevtestplan/plot

cgdatasetnode/plot

mpc/plot

rfckt.plot

frd/plot

dspdata.plot

wdectree/plot

ntree/plot

dtree/plot

wvtree/plot

rwvtree/plot

edwttree/plot

Reference page in Help browser

doc plot

<loglog> - Log-log scale plot.

LOGLOG Log-log scale plot.

LOGLOG(...) is the same as PLOT(...), except logarithmic

scales are used for both the X- and Y- axes.

See also plot, semilogx, semilogy.

Overloaded methods:

rfckt.loglog

frd/loglog

Reference page in Help browser

doc loglog

<semilogx> - Semi-log scale plot.

SEMILOGX Semi-log scale plot.

SEMILOGX(...) is the same as PLOT(...), except a

logarithmic (base 10) scale is used for the X-axis.

See also plot, semilogy, loglog.

Overloaded methods:

rfckt.semilogx

frd/semilogx

Reference page in Help browser

doc semilogx

<semilogy> - Semi-log scale plot.

SEMILOGY Semi-log scale plot.

SEMILOGY(...) is the same as PLOT(...), except a

logarithmic (base 10) scale is used for the Y-axis.

See also plot, semilogx, loglog.

Overloaded methods:

rfckt.semilogy

frd/semilogy

Reference page in Help browser

doc semilogy

<polar> - Polar coordinate plot.

POLAR Polar coordinate plot.

POLAR(THETA, RHO) makes a plot using polar coordinates of

the angle THETA, in radians, versus the radius RHO.

POLAR(THETA, RHO, S) uses the linestyle specified in string S.

See PLOT for a description of legal linestyles.

POLAR(AX, ...) plots into AX instead of GCA.

H = POLAR(...) returns a handle to the plotted object in H.

Example:

t = 0 : .01 : 2 * pi;

polar(t, sin(2 * t) .* cos(2 * t), '--r');

See also plot, loglog, semilogx, semilogy.

Overloaded methods:

rfckt.polar

Reference page in Help browser

doc polar

<plotyy> - Graphs with y tick labels on the left and right.

PLOTYY Graphs with y tick labels on the left and right

PLOTYY(X1,Y1,X2,Y2) plots Y1 versus X1 with y-axis labeling

on the left and plots Y2 versus X2 with y-axis labeling on

the right.

PLOTYY(X1,Y1,X2,Y2,FUN) uses the plotting function FUN

instead of PLOT to produce each graph. FUN can be a

function handle or a string that is the name of a plotting

function, e.g. plot, semilogx, semilogy, loglog, stem,

etc. or any function that accepts the syntax H = FUN(X,Y).

For example

PLOTYY(X1,Y1,X2,Y2,@loglog) % Function handle

PLOTYY(X1,Y1,X2,Y2,'loglog') % String

PLOTYY(X1,Y1,X2,Y2,FUN1,FUN2) uses FUN1(X1,Y1) to plot the data for

the left axes and FUN2(X2,Y2) to plot the data for the right axes.

PLOTYY(AX,...) plots into AX as the main axes, instead of GCA. If AX

is the vector of axes handles returned by a previous call to PLOTYY,

then the secondary axes will be ignored.

[AX,H1,H2] = PLOTYY(...) returns the handles of the two axes created in

AX and the handles of the graphics objects from each plot in H1

and H2. AX(1) is the left axes and AX(2) is the right axes.

See also plot, function_handle

Overloaded methods:

rfckt.plotyy

Reference page in Help browser

doc plotyy

Axis control

<axis> - Control axis scaling and appearance.

AXIS Control axis scaling and appearance.

AXIS([XMIN XMAX YMIN YMAX]) sets scaling for the x- and y-axes

on the current plot.

AXIS([XMIN XMAX YMIN YMAX ZMIN ZMAX]) sets the scaling for the

x-, y- and z-axes on the current 3-D plot.

AXIS([XMIN XMAX YMIN YMAX ZMIN ZMAX CMIN CMAX]) sets the

scaling for the x-, y-, z-axes and color scaling limits on

the current axis (see CAXIS).

V = AXIS returns a row vector containing the scaling for the

current plot. If the current view is 2-D, V has four

components; if it is 3-D, V has six components.

AXIS AUTO returns the axis scaling to its default, automatic

mode where, for each dimension, 'nice' limits are chosen based

on the extents of all line, surface, patch, and image children.

AXIS MANUAL freezes the scaling at the current limits, so that if

HOLD is turned on, subsequent plots will use the same limits.

AXIS TIGHT sets the axis limits to the range of the data.

AXIS FILL sets the axis limits and PlotBoxAspectRatio so that

the axis fills the position rectangle. This option only has

an effect if PlotBoxAspectRatioMode or DataAspectRatioMode are

manual.

AXIS IJ puts MATLAB into its "matrix" axes mode. The coordinate

system origin is at the upper left corner. The i axis is

vertical and is numbered from top to bottom. The j axis is

horizontal and is numbered from left to right.

AXIS XY puts MATLAB into its default "Cartesian" axes mode. The

coordinate system origin is at the lower left corner. The x

axis is horizontal and is numbered from left to right. The y

axis is vertical and is numbered from bottom to top.

AXIS EQUAL sets the aspect ratio so that equal tick mark

increments on the x-,y- and z-axis are equal in size. This

makes SPHERE(25) look like a sphere, instead of an ellipsoid.

AXIS IMAGE is the same as AXIS EQUAL except that the plot

box fits tightly around the data.

AXIS SQUARE makes the current axis box square in size.

AXIS NORMAL restores the current axis box to full size and

removes any restrictions on the scaling of the units.

This undoes the effects of AXIS SQUARE and AXIS EQUAL.

AXIS VIS3D freezes aspect ratio properties to enable rotation of

3-D objects and overrides stretch-to-fill.

AXIS OFF turns off all axis labeling, tick marks and background.

AXIS ON turns axis labeling, tick marks and background back on.

AXIS(H,...) changes the axes handles listed in vector H.

See also axes, grid, subplot, xlim, ylim, zlim.

Overloaded methods:

vrjoystick/axis

Reference page in Help browser

doc axis

<zoom> - Zoom in and out on a 2-D plot.

ZOOM Zoom in and out on a 2-D plot.

ZOOM with no arguments toggles the zoom state.

ZOOM(FACTOR) zooms the current axis by FACTOR.

Note that this does not affect the zoom state.

ZOOM ON turns zoom on for the current figure.

ZOOM XON or ZOOM YON turns zoom on for the x or y axis only.

ZOOM OFF turns zoom off in the current figure.

ZOOM RESET resets the zoom out point to the current zoom.

ZOOM OUT returns the plot to its current zoom out point.

If ZOOM RESET has not been called this is the original

non-zoomed plot. Otherwise it is the zoom out point

set by ZOOM RESET.

When zoom is on, click the left mouse button to zoom in on the

point under the mouse. Each time you click, the axes limits will be

changed by a factor of 2 (in or out). You can also click and drag

to zoom into an area. It is not possible to zoom out beyond the plots'

current zoom out point. If ZOOM RESET has not been called the zoom

out point is the original non-zoomed plot. If ZOOM RESET has been

called the zoom out point is the zoom point that existed when it

was called. Double clicking zooms out to the current zoom out point -

the point at which zoom was first turned on for this figure

(or to the point to which the zoom out point was set by ZOOM RESET).

Note that turning zoom on, then off does not reset the zoom out point.

This may be done explicitly with ZOOM RESET.

ZOOM(FIG,OPTION) applies the zoom command to the figure specified

by FIG. OPTION can be any of the above arguments.

H = ZOOM(FIG) returns the figure's zoom mode object for customization.

The following properties can be modified using set/get:

ButtonDownFilter <function_handle>

The application can inhibit the zoom operation under circumstances

the programmer defines, depending on what the callback returns.

The input function handle should reference a function with two

Соседние файлы в папке Библиотеки Matlab