Display areas where inequalities are fulfilled

MuPAD® notebooks will be removed in a future release. 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.


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)


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.


AttributePurposeDefault Value
AffectViewingBoxinfluence of objects on the ViewingBox of a sceneTRUE
AntiAliasedantialiased lines and points?FALSE
FillPatterntype of area fillingSolid
FillColorTruethe color for “true” areas (inequality plot)RGB::Green
FillColorFalsethe color for “false” areas (inequality plot)RGB::Red
FillColorUnknownthe color for “unknown” areas (inequality plot)RGB::Black
Framesthe number of frames in an animation50
Inequalitiesinequalities displayed in inequality plots 
Legendmakes a legend entry 
LegendTextshort explanatory text for legend 
LegendEntryadd this object to the legend?FALSE
LineColorcolor of linesRGB::Blue
LineWidthwidth of lines0.35
LineStylesolid, dashed or dotted lines?Solid
LinesVisiblevisibility of linesFALSE
Meshnumber of sample points[256, 256]
Namethe name of a plot object (for browser and legend) 
ParameterEndend value of the animation parameter 
ParameterNamename of the animation parameter 
ParameterBegininitial value of the animation parameter 
ParameterRangerange of the animation parameter 
TimeEndend time of the animation10.0
TimeBeginstart time of the animation0.0
TimeRangethe real time span of an animation0.0 .. 10.0
Titleobject title 
TitleFontfont of object titles[" sans-serif ", 11]
TitlePositionposition of object titles 
TitleAlignmenthorizontal alignment of titles w.r.t. their coordinatesCenter
TitlePositionXposition of object titles, x component 
TitlePositionYposition of object titles, y component 
VisibleAfterobject visible after this time value 
VisibleBeforeobject visible until this time value 
VisibleFromToobject visible during this time range 
VisibleAfterEndobject visible after its animation time ended?TRUE
VisibleBeforeBeginobject visible before its animation time starts?TRUE
XMaxfinal value of parameter “x” 
XMeshnumber of sample points for parameter “x”256
XMininitial value of parameter “x” 
XNamename of parameter “x” 
XRangerange of parameter “x” 
YMaxfinal value of parameter “y” 
YMeshnumber of sample points for parameter “y”256
YMininitial value of parameter “y” 
YNamename of parameter “y” 
YRangerange of parameter “y” 


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))


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.


Animation parameter, specified as a = amin..amax, where amin is the initial parameter value, and amax is the final parameter value.

See Also

MuPAD Functions

MuPAD Graphical Primitives