Previous Page Next Page Contents

plot -- display graphical objects on the screen

Introduction

plot(scene) displays a graphical scene on the screen.

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

Call(s)

plot(scene)
plot(object1 <, object2...> <, option1, option2...>)

Parameters

scene - a graphical scene: an object of domain type plot::Scene
object1, object2, ... - 2D or 3D graphical objects
option1, option2, ... - scene options of the form OptionName = value

Overloadable:

object1

Related Domains

plot::Scene

Related Functions

plot2d, plot3d

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

This call uses the default values of the scene options as documented on the help page of plot::Scene. Scene options may be passed as additional parameters to plot. For example, to draw grid lines in the background of the previous plot, we enter:

>> plot(f1, f2, GridLines = Automatic)

See plotOptions2d for details on the GridLines option.

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

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

Here we used the Scaling option to guarantee an aspect ratio 1:1 between the x and y coordinates independent of the window size (see plotOptions2d for details).

Background

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000