# Documentation

### This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

# `plot`::`Inequality`

Display areas where inequalities are fulfilled

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

## Syntax

```plot::Inequality(`ineq`, `x = xmin .. xmax`, `y = ymin .. ymax`, <`a = amin .. amax`>, `options`)
plot::Inequality(`[ineq1, …]`, `x = xmin .. xmax`, `y = ymin .. ymax`, <`a = amin .. amax`>, `options`)
```

## Description

```plot::Inequality(f(x, y) < g(x, y), x = `x_{min}`..`x_{max}` , y = `y_{min}`..`y_{max}` )``` fills the rectangle ```xmin ≤ x ≤ xmax```, ```ymin ≤ y ≤ ymax``` with several colors, indicating which points satisfy the inequality.

`plot::Inequality` computes a (more or less coarse) rasterization of the area specified by ``x_{min}`..`x_{max}`` and ``y_{min}`..`y_{max}`` and colors subareas according to whether all of the given inequalities are fulfilled (these are colored in `FillColorTrue`), at least one inequality is nowhere fulfilled in the subarea (`FillColorFalse`) or the granularity is insufficient to decide for either of these cases (`FillColorUnknown`).

You can control the density of the rasterization with the attribute `Mesh`. Cf. Example 2.

`plot::Inequality` uses interval numerics for evaluation, so the results are reliable, but certain special functions (such as `hypergeom`) cannot be used because they are not supported for intervals.

## Attributes

AttributePurposeDefault Value
`AffectViewingBox`influence of objects on the `ViewingBox` of a scene`TRUE`
`AntiAliased`antialiased lines and points?`FALSE`
`FillPattern`type of area filling`Solid`
`FillColorTrue`the color for “true” areas (inequality plot)`RGB::Green`
`FillColorFalse`the color for “false” areas (inequality plot)`RGB::Red`
`FillColorUnknown`the color for “unknown” areas (inequality plot)`RGB::Black`
`Frames`the number of frames in an animation`50`
`Inequalities`inequalities displayed in inequality plots
`Legend`makes a legend entry
`LegendText`short explanatory text for legend
`LegendEntry`add this object to the legend?`FALSE`
`LineColor`color of lines`RGB::Blue`
`LineWidth`width of lines`0.35`
`LineStyle`solid, dashed or dotted lines?`Solid`
`LinesVisible`visibility of lines`FALSE`
`Mesh`number of sample points[`256`, `256`]
`Name`the name of a plot object (for browser and legend)
`ParameterEnd`end value of the animation parameter
`ParameterName`name of the animation parameter
`ParameterBegin`initial value of the animation parameter
`ParameterRange`range of the animation parameter
`TimeEnd`end time of the animation`10.0`
`TimeBegin`start time of the animation`0.0`
`TimeRange`the real time span of an animation`0.0` .. `10.0`
`Title`object title
`TitleFont`font of object titles[`" sans-serif "`, `11`]
`TitlePosition`position of object titles
`TitleAlignment`horizontal alignment of titles w.r.t. their coordinates`Center`
`TitlePositionX`position of object titles, x component
`TitlePositionY`position of object titles, y component
`Visible`visibility`TRUE`
`VisibleAfter`object visible after this time value
`VisibleBefore`object visible until this time value
`VisibleFromTo`object visible during this time range
`VisibleAfterEnd`object visible after its animation time ended?`TRUE`
`VisibleBeforeBegin`object visible before its animation time starts?`TRUE`
`XMax`final value of parameter “x”
`XMesh`number of sample points for parameter “x”`256`
`XMin`initial value of parameter “x”
`XName`name of parameter “x”
`XRange`range of parameter “x”
`YMax`final value of parameter “y”
`YMesh`number of sample points for parameter “y”`256`
`YMin`initial value of parameter “y”
`YName`name of parameter “y”
`YRange`range of parameter “y”

## Examples

### Example 1

With a single inequality, `plot::Inequality` colors the area where it is fulfilled or violated, with areas at the border line, where the inequality is fulfilled in some parts of the rectangle and violated in other parts:

```plot(plot::Inequality(x^2 + y^2 < 1, x = -1.5..1.5, y = -1.5..1.5))```

When giving more than one inequality, only those areas where all inequalities are fulfilled are painted in blue (or whatever you set `FillColorTrue` to), while all rectangles where any inequality is violated (over the whole rectangle) are colored red:

```plot(plot::Inequality([x^2 + y^2 < 1, abs(x) > 1/3], x = -1.5..1.5, y = -1.5..1.5))```

### Example 2

To get a more detailed image from `plot::Inequality`, increase the mesh density:

```plot(plot::Inequality([x^2 + y^2 < 1, abs(x) > 1/3], x = -1.5..1.5, y = -1.5..1.5, Mesh = [120, 80]))```

### Example 3

Almost all parameters of `plot::Inequality` can be animated (the mesh is one exception though):

```plot(plot::Inequality([abs(x)^a + abs(y)^a < 1], x = -1.5+sin(a)..1.5+sin(a), y = -1.5+cos(a)..1.5+cos(a), Mesh = [64, 64], a = 1..2*PI+1))```

## Parameters

 `ineq, ineq1, …` Inequalities to plot: Expressions of the form ```f(x, y) < g(x, y)```, `f(x, y) <= g(x, y)`, ```f(x, y) = g(x, y)```, `f(x, y) >= g(x, y)`, or `f(x, y) > g(x, y)`. `ineq`, `ineq1`, … is equivalent to the attribute `Inequalities`. `x`, `y` Identifiers or indexed identifiers. These denote the free variables spanning the plane. `x`, `y` are equivalent to the attributes `XName`, `YName`. `xmin .. xmax`, `ymin .. ymax` The ranges for `x` and `y`. `xmin`, `xmax`, `ymin`, and `ymax` must be real numerical values, or expressions of the animation parameter `a`. `xmin` .. `xmax`, `ymin` .. `ymax` are equivalent to the attributes `XRange`, `YRange`. `a` Animation parameter, specified as `a```` = amin..amax```, where `amin` is the initial parameter value, and `amax` is the final parameter value.

## See Also

### MuPAD Graphical Primitives

Was this topic helpful?

#### Mathematical Modeling with Symbolic Math Toolbox

Get examples and videos