Skip to Main Content Skip to Search
Product Documentation

plotdisplay graphical objects on the screen

displaydisplay graphical objects on the screen

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

display(object1, object2, ...) is equivalent to the above command.

→ Examples

Calls:

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

display(object1, <object2, ...>, <attribute1, attribute2, ...>)

Parameters:

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:

object1

Related Functions:

plot::easy, plotfunc2d, plotfunc3d

See Also:

See the plot document for detailed information.

Details:

Example 1

The following calls return objects representing the graphs of the sine and the cosine function on the interval [0, 2*PI]:

f1 := plot::Function2d(sin(x), x = 0..2*PI, Color = RGB::Red);
f2 := plot::Function2d(cos(x), x = 0..2*PI, Color = RGB::Blue)

plot::Function2d(sin(x), x = 0..2*PI)
plot::Function2d(cos(x), x = 0..2*PI)

The following call renders these graphs:

plot(f1, f2)

MuPAD graphics

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)

MuPAD graphics

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 x^2 + x + 2 = y^2 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)

MuPAD graphics

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

Background:

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

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS