Display graphical objects on the screen
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.
plot(object_{1}
, <object_{2}, …
>, <attribute_{1}, attribute_{2}, …
>)
plot(object_{1}, object_{2},
...)
displays the graphical objects object_{1}
, object_{2}
etc.
on the screen.
plot()
creates an empty graphical 2D scene.
display
and plot
are
equivalent.
This function calls plot::easy
for
preprocessing its input.
The parameters object_{1}
, object_{2}
and
so on, must be accepted by plot::easy
or
directly be graphical objects generated by routines of the plot library.
This library provides many such objects including:
function graphs (plot::Function2d
, plot::Function3d
),
curves (plot::Curve2d
, plot::Curve3d
),
points (plot::Point2d
, plot::Point3d
),
lines (plot::Line2d
, plot::Line3d
),
polygons (plot::Polygon2d
, plot::Polygon3d
),
surfaces (of domain type plot::Surface
)
and many more. See Example 1.
There are also many high level objects, such as plot::VectorField2d
, plot::Ode2d
, plot::Ode3d
, plot::Implicit2d
, plot::Implicit3d
, that
can also be rendered by plot
. See Example 2.
Graphical attributes attribute1
, attribute2
,
and so on, are specified by equations of the form AttributeName
= AttributeValue
. There are several hundred such attributes
that allow to modify almost any aspect of the graphics.
Note:
The graphical objects 
Use the following calls to return objects representing the graphs of the sine and the cosine function on the interval [0, 2 π]:
f1 := plot::Function2d(sin(x), x = 0..2*PI, Color = RGB::Red); f2 := plot::Function2d(cos(x), x = 0..2*PI, Color = RGB::Blue)
The following call renders these graphs:
plot(f1, f2)
Apart from the explicitly requested colors, this call uses the
default values of all graphical attributes. If different values are
desired, an arbitrary number of attributes can be passed as additional
parameters to plot
. For example, to draw grid lines
in the background of the previous plot, use:
plot(f1, f2, GridVisible = TRUE)
delete f1, f2:
The plot library contains various routines for creating more complex graphical objects, such as vectorfields, solution curves of ordinary differential equations, and implicitly defined curves.
For example, to plot the implicitly defined curve x^{2} + x +
2 = y^{2} with x, y from
the interval [ 5, 5], use
the function plot::Implicit2d
:
plot(plot::Implicit2d(x^3 + x + 2 = y^2, x = 5..5, y = 5..5), Scaling = Constrained)
Here the Scaling
attribute guarantees an aspect
ratio 1:1 between the x and y coordinates
independent of the window size.

2D or 3D graphical objects of the plot library or expressions
acceptable by 

Graphical attributes of the form 
object_1
Technically, plot
is not a function but a
domain representing the library plot library. Thus, when calling plot(...)
,
the method plot
is called.