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

2 Inches.

Uses code by R. Pawlowicz to handle inline contour labels.

Example

subplot(1, 3, 1); [cs, h] = contour(peaks); clabel(cs, h, 'labelspacing', 72);

subplot(1, 3, 2); cs = contour(peaks); clabel(cs);

subplot(1, 3, 3); [cs, h] = contour(peaks);

clabel(cs, h, 'FontSize', 15, 'Color', 'r', 'Rotation', 0);

See also contour, contour3, contourf.

Reference page in Help browser

doc clabel

<ezcontour> - Easy to use contour plotter.

EZCONTOUR Easy to use contour plotter

EZCONTOUR(FUN) plots the contour lines of FUN(X,Y) using CONTOUR. FUN

is plotted over the default domain -2*PI < X < 2*PI, -2*PI < Y < 2*PI.

EZCONTOUR(FUN,DOMAIN) plots FUN over the specified DOMAIN instead of

the default domain. DOMAIN can be the vector [XMIN,XMAX,YMIN,YMAX]

or the vector [A,B] (to plot over A < X < B and A < Y < B).

EZCONTOUR(...,N) plots FUN over the default domain using an N-by-N

grid. The default value for N is 60.

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

H = EZCONTOUR(...) returns handles to contour objects in H.

Examples:

The easiest way to express a function is via a string:

ezcontour('x*exp(-x^2 - y^2)')

One programming technique is to vectorize the string expression using

the array operators .* (TIMES), ./ (RDIVIDE), .\ (LDIVIDE), .^ (POWER).

This makes the algorithm more efficient since it can perform multiple

function evaluations at once.

ezcontour('x.*exp(-x.^2 - y.^2)')

You may also use a function handle to an existing function. Function

handles are more powerful and efficient than string expressions.

ezcontour(@peaks)

EZCONTOUR plots the variables in string expressions alphabetically.

subplot(1,2,1), ezcontour('x.*exp(-x.^2 - y.^2)')

To avoid this ambiguity, specify the order with an anonymous function:

subplot(1,2,2), ezcontour(@(y,x)x.*exp(-x.^2 - y.^2))

If your function has additional parameters, for example k in myfun:

%-----------------------%

function z = myfun(x,y,k)

z = x.^k - y.^k - 1;

%-----------------------%

then you may use an anonymous function to specify that parameter:

ezcontour(@(x,y)myfun(x,y,2))

See also ezplot, ezplot3, ezpolar, ezcontourf, ezsurf, ezmesh,

ezsurfc, ezmeshc, contour, vectorize, function_handle.

Overloaded methods:

sym/ezcontour

Reference page in Help browser

doc ezcontour

<ezcontourf> - Easy to use filled contour plotter.

EZCONTOURF Easy to use filled contour plotter

EZCONTOURF(FUN) plots the contour lines of FUN(X,Y) using CONTOURF. FUN

is plotted over the default domain -2*PI < X < 2*PI, -2*PI < Y < 2*PI.

EZCONTOURF(FUN,DOMAIN) plots FUN over the specified DOMAIN instead of

the default domain. DOMAIN can be the vector [XMIN,XMAX,YMIN,YMAX] or

the vector [A,B] (to plot over A < X < B and A < Y < B).

EZCONTOURF(...,N) plots FUN over the default domain using an N-by-N

grid. The default value for N is 60.

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

H = EZCONTOURF(...) returns handles to contour objects in H.

Examples:

The easiest way to express a function is via a string:

ezcontourf('x*exp(-x^2 - y^2)')

One programming technique is to vectorize the string expression using

the array operators .* (TIMES), ./ (RDIVIDE), .\ (LDIVIDE), .^ (POWER).

This makes the algorithm more efficient since it can perform multiple

function evaluations at once.

ezcontourf('x.*exp(-x.^2 - y.^2)')

You may also use a function handle to an existing function. Function

handles are more powerful and efficient than string expressions.

ezcontourf(@peaks)

EZCONTOURF plots the variables in string expressions alphabetically.

subplot(1,2,1), ezcontourf('x.*exp(-x.^2 - y.^2)')

To avoid this ambiguity, specify the order with an anonymous function:

subplot(1,2,2), ezcontourf(@(y,x)x.*exp(-x.^2 - y.^2))

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