Display graphical objects on the screen

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.


plot(object1, <object2, …>, <attribute1, attribute2, …>)


plot( object1, object2, ...) displays the graphical objects object1, object2 etc. on the screen.

This function calls plot::easy for preprocessing its input.

The parameters object1, object2 etc. 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:

and many more. Cf. Example 1.

There are also many high level objects such as plot::VectorField2d, plot::Ode2d, plot::Ode3d, plot::Implicit2d, plot::Implicit3d etc. that can also be rendered by plot, display. Cf. Example 2.

Graphical attributes attribute1, attribute2 etc. 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 object1, object2 etc. must have the same dimension. A mix of 2D and 3D objects in one plot is not supported!

The command plot() creates an empty graphical 2D scene.


Example 1

The following calls 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 may be passed as additional parameters to plot, display. For example, to draw grid lines in the background of the previous plot, we enter:

plot(f1, f2, GridVisible = TRUE)

delete f1, f2:

Example 2

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 x2 + x + 2 = y2 with x, y from the interval [- 5, 5], we use the function plot::Implicit2d:

plot(plot::Implicit2d(x^3 + x + 2 = y^2,
                      x = -5..5, y = -5..5),
     Scaling = Constrained)

Here we used the Scaling attribute to guarantee an aspect ratio 1:1 between the x and y coordinates independent of the window size.


object1, object2, …

2D or 3D graphical objects of the plot library or expressions accepted by plot::easy

attribute1, attribute2, …

Graphical attributes of the form AttributeName = AttributeValue

Overloaded By



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

See Also

MuPAD Functions

More About

Was this topic helpful?