Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the page.

# fimplicit

Plot implicit function

## Syntax

``fimplicit(f)``
``fimplicit(f,interval)``
``fimplicit(ax,___)``
``fimplicit(___,LineSpec)``
``fimplicit(___,Name,Value)``
``fp = fimplicit(___)``

## Description

example

````fimplicit(f)` plots the implicit function defined by `f(x,y) = 0` over the default interval `[-5 5]` for `x` and `y`.```

example

````fimplicit(f,interval)` specifies the plotting interval for `x` and `y`.```
````fimplicit(ax,___)` plots into the axes specified by `ax` instead of into the current axes. Specify the axes as the first input argument, prior to any of the previous input arguments.```

example

````fimplicit(___,LineSpec)` specifies the line style, marker symbol, and line color. For example, `'-r'` plots a red line.```

example

````fimplicit(___,Name,Value)` specifies line properties using one or more name-value pair arguments. For example, `'LineWidth',2` specifies a line width of 2 points.```

example

````fp = fimplicit(___)` returns the `ImplicitFunctionLine` object. Use `fp` to access and modify properties of the line after it is created. For a list of properties, see ImplicitFunctionLine Properties.```

## Examples

collapse all

Plot the hyperbola described by the function over the default interval of `[-5 5]` for x and y.

`fimplicit(@(x,y) x.^2 - y.^2 - 1)`

Plot the function over the intervals `[-3 0]` for `x` and `[-2 2]` for `y`.

```f = @(x,y) x.^2 + y.^2 - 3; fimplicit(f,[-3 0 -2 2])```

Plot two circles centered at `(0,0)` with different radius values. For the first circle, use a dotted, red line. For the second circle, use a dashed, green line with a line width of 2 points.

```f1 = @(x,y) x.^2 + y.^2 - 1; fimplicit(f1,':r') hold on f2 = @(x,y) x.^2 + y.^2 - 2; fimplicit(f2,'--g','LineWidth',2) hold off```

Plot the implicit function and assign the implicit function line object to the variable `fp`.

`fp = fimplicit(@(x,y) y.*sin(x) + x.*cos(y) - 1)`

```fp = ImplicitFunctionLine with properties: Function: @(x,y)y.*sin(x)+x.*cos(y)-1 Color: [0 0.4470 0.7410] LineStyle: '-' LineWidth: 0.5000 Show all properties ```

Use `fp` to access and modify properties of the implicit function line object after it is created. For example, change the color, line style, and line width.

```fp.Color = 'r'; fp.LineStyle = '--'; fp.LineWidth = 2;```

## Input Arguments

collapse all

Implicit function to plot, specified as a function handle to a named or anonymous function.

Specify a function of the form `z = f(x,y)`. The function must accept two matrix input arguments and return a matrix output argument of the same size. Use array operators instead of matrix operators for the best performance. For example, use `.*` (`times`) instead of * (`mtimes`).

Example: `fimplicit(@(x,y) x.^2 - y.^2 + 1)`

Plotting interval for `x` and `y`, specified in one of these forms:

• Two-element vector of the form `[min max]` — Use the same plotting interval of `[min max]` for both `x` and `y`.

• Four-element vector of the form ```[xmin xmax ymin ymax]``` — Use different plotting intervals for `x` and `y`. Plot over the interval `[xmin xmax]` for `x` and ```[ymin ymax]``` for `y`.

Example: `fimplicit(f,[-2 3 -5 0])`

Line style, marker symbol, and color, specified as a character vector or string containing symbols. The symbols can appear in any order. You do not need to specify all three characteristics (line style, marker symbol, and color). For example, if you omit the line style and specify the marker, then the plot shows only the markers and no line.

Example: `fimplicit(f,'--or')` plots a red, dashed line with circle markers.

Line StyleDescription
`-`Solid line (default)
`--`Dashed line
`:`Dotted line
`-.`Dash-dot line
MarkerDescription
`o`Circle
`+`Plus sign
`*`Asterisk
`.`Point
`x`Cross
`s`Square
`d`Diamond
`^`Upward-pointing triangle
`v`Downward-pointing triangle
`>`Right-pointing triangle
`<`Left-pointing triangle
`p`Pentagram
`h`Hexagram
ColorDescription

`y`

yellow

`m`

magenta

`c`

cyan

`r`

red

`g`

green

`b`

blue

`w`

white

`k`

black

Axes object. If you do not specify the axes, then `fimplicit` uses the current axes.

### Name-Value Pair Arguments

Specify optional comma-separated pairs of `Name,Value` arguments. `Name` is the argument name and `Value` is the corresponding value. `Name` must appear inside quotes. You can specify several name and value pair arguments in any order as `Name1,Value1,...,NameN,ValueN`.

Example: `fimplicit(f,'MeshDensity',50,'LineWidth',2)` specifies the number of evaluation points and the line width.

The `ImplicitFunctionLine` properties listed here are only a subset. For a complete list, see ImplicitFunctionLine Properties.

Number of evaluation points per direction, specified as a scalar.

Line color, specified as an RGB triplet or one of the color options listed in the table.

For a custom color, specify an RGB triplet. An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range `[0,1]`; for example, `[0.4 0.6 0.7]`. Alternatively, you can specify some common colors by name. This table lists the long and short color name options and the equivalent RGB triplet values.

OptionDescriptionEquivalent RGB Triplet
`'red'` or `'r'`Red`[1 0 0]`
`'green'` or `'g'`Green`[0 1 0]`
`'blue'` or `'b'`Blue`[0 0 1]`
`'yellow'` or `'y'`Yellow`[1 1 0]`
`'magenta'` or `'m'`Magenta`[1 0 1]`
`'cyan'` or `'c'`Cyan`[0 1 1]`
`'white'` or `'w'`White`[1 1 1]`
`'black'` or `'k'`Black`[0 0 0]`
`'none'`No colorNot applicable

Example: `'blue'`

Example: ```[0 0 1]```

Line style, specified as one of the options listed in this table.

Line StyleDescriptionResulting Line
`'-'`Solid line

`'--'`Dashed line

`':'`Dotted line

`'-.'`Dash-dotted line

`'none'`No lineNo line

Line width, specified as a positive value in points. If the line has markers, then the line width also affects the marker edges.

Example: `0.75`

Marker symbol, specified as one of the markers listed in this table. By default, the line does not have markers. Specifying a marker symbol adds markers at selected points along the line.

ValueDescription
`'o'`Circle
`'+'`Plus sign
`'*'`Asterisk
`'.'`Point
`'x'`Cross
`'square'` or `'s'`Square
`'diamond'` or `'d'`Diamond
`'^'`Upward-pointing triangle
`'v'`Downward-pointing triangle
`'>'`Right-pointing triangle
`'<'`Left-pointing triangle
`'pentagram'` or `'p'`Five-pointed star (pentagram)
`'hexagram'` or `'h'`Six-pointed star (hexagram)
`'none'`No markers

Example: `'+'`

Example: `'diamond'`

Marker size, specified as a positive value in points.

Example: `10`

Marker outline color, specified as `'auto'`, an RGB triplet, or one of the color options listed in the table. The default value of `'auto'` uses the same color as the `Color` property.

For a custom color, specify an RGB triplet. An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range `[0,1]`; for example, `[0.4 0.6 0.7]`. Alternatively, you can specify some common colors by name. This table lists the long and short color name options and the equivalent RGB triplet values.

OptionDescriptionEquivalent RGB Triplet
`'red'` or `'r'`Red`[1 0 0]`
`'green'` or `'g'`Green`[0 1 0]`
`'blue'` or `'b'`Blue`[0 0 1]`
`'yellow'` or `'y'`Yellow`[1 1 0]`
`'magenta'` or `'m'`Magenta`[1 0 1]`
`'cyan'` or `'c'`Cyan`[0 1 1]`
`'white'` or `'w'`White`[1 1 1]`
`'black'` or `'k'`Black`[0 0 0]`
`'none'`No colorNot applicable

Example: `[0.5 0.5 0.5]`

Example: `'blue'`

Marker fill color, specified as `'auto'`, an RGB triplet, or one of the color options listed in the table. The `'auto'` value uses the same color as the `MarkerEdgeColor` property.

For a custom color, specify an RGB triplet. An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range `[0,1]`; for example, `[0.4 0.6 0.7]`. Alternatively, you can specify some common colors by name. This table lists the long and short color name options and the equivalent RGB triplet values.

OptionDescriptionEquivalent RGB Triplet
`'red'` or `'r'`Red`[1 0 0]`
`'green'` or `'g'`Green`[0 1 0]`
`'blue'` or `'b'`Blue`[0 0 1]`
`'yellow'` or `'y'`Yellow`[1 1 0]`
`'magenta'` or `'m'`Magenta`[1 0 1]`
`'cyan'` or `'c'`Cyan`[0 1 1]`
`'white'` or `'w'`White`[1 1 1]`
`'black'` or `'k'`Black`[0 0 0]`
`'none'`No colorNot applicable

Example: `[0.3 0.2 0.1]`

Example: `'green'`

## Tips

• Use element-wise operators for the best performance and to avoid a warning message. For example, use `x.*y` instead of `x*y`. For more information, see Array vs. Matrix Operations.

• When you zoom in on the chart, `fimplicit` recalculates the data, which can reveal hidden details.