fimplicit

Plots an implicit curve defined by f(x,y) = 0.

Category: Graphics > 2-D and 3-D Plots

Syntax

fimplicit(f)

Plots the set where f(x,y) = 0 over the default region -5 < x < 5, -5 < y < 5.

fimplicit(f, [min max])

Uses the same interval for x and y.

fimplicit(f, [xmin xmax ymin ymax])

Sets each interval.

h = fimplicit(___)

Also returns the line handle.

Description

Curves that cannot be solved for y, such as a circle or an ellipse, can be drawn directly. To plot g(x,y) = c, pass @(x,y) g(x,y) - c.

Input arguments

f
Function handle of x and y. The curve is where its value is zero.
interval
Two or four numbers that set the region.

Output arguments

h
Handle to the implicit function line.

Example

Circle and ellipse

fimplicit(@(x,y) x.^2 + y.^2 - 1, [-2 2])
hold on
fimplicit(@(x,y) x.^2/4 + y.^2 - 1)
hold off
axis equal

In the app, the figure is drawn below the code.

See also

fplot fcontour ezplot contour