Previous Page Next Page Contents

plot::Point -- graphical primitive for a point

Introduction

plot::Point(x, y) represents a plot of a two-dimensional point with the coordinates (x; y).

plot::Point(x, y, z) represents a plot of a three-dimensional point with the coordinates (x; y; z).

Creating Elements

plot::Point(x, y <, option1, option2...>)
plot::Point(x, y, z <, option1, option2...>)

Parameters

x, y, z - arithmetical expressions
option1, option2, ... - plot option(s) of the form OptionName = value

Related Domains

DOM_POINT, plot::Pointlist, plot::Scene, RGB

Related Functions

plot, plot2d, plot3d, plot::copy, point

Details

Operands

An object of plot::Point has either two or three operands, namely the coordinates x, y and z, respectively.

Important Operations

Operands of a point primitive can be accessed either using the system function op, the index operator [ ], or using the attribute coords described above. For example, if point is such an object, then the calls op(point,1), point[1] and point::coords[1] return the first coordinate of point.

Via point[1] := x_new or point::coords[1] := x_new, the first coordinate of point is replaced by x_new.

See the methods "op", "_index", "set_index" and "slot" below.

Use the slot operator :: to get or set plot options of such objects afterwards, i.e., when they have been created. For example, if point is such an object, then point::Color := RGB::Red changes the color of the point to red.

Result of Evaluation

Evaluating an object of type plot::Point returns itself.

Function Call

Calling an object of plot::Point as a function yields the object itself, regardless of the arguments. The arguments are not evaluated.

Entries

defaultOptions

is a table of plot options for point primitives and their default values. Each entry has the form OptionName = default_value.

When an object of the domain plot::Point is created, then a copy of this table is stored under the attribute options (see the table of attributes above), where those options are added and replaced, respectively, which are given by the (optional) parameters option1, option2... of the creating call (see ``Creating Elements'' above).

Plot options, which are not contained in the table stored under the attribute options will not be included in the plot data of the object created by the method "getPlotdata" (see below).

For those options, the corresponding default value either is set by a graphical scene, if the option also exists as a scene option (such as the option PointWidth), or it is internally set by the function plot2d and plot3d, respectively, which are used to plot the object. See the table of plot options above, which gives a summary of the available plot options for point primitives and their default values.

To change the default value of some plot options, the option name and its default value may be added to the table "defaultOptions", or replaced by a new value, respectively.

optionNames

is a set of the available option names for plots of points.

Method _index: indexed access to the operands of a point primitive

Method dimension: dimension of a point primitive

Method getPlotdata: create the plot data of a point primitive

Method nops: number of operands of a point primitive

Method op: extract operands of a point primitive

Method set_index: set operands of a point primitive

Method slot: read and write attributes and plot options

Method convert: conversion of objects into a point primitive

Method convert_to: conversion of a point primitive

Method expr: conversion into a system point primitive

Method checkOption: check a plot option

Method copy: create a copy of a point primitive

Method modify: modify a copy of a point primitive

Method print: print a point primitive

Example 1

We create the points (1; 2) and (3; -1), setting the color of the second point to green and its size to 50:

>> p1 := plot::Point([1, 2]);
   p2 := plot::Point([3, 1], Color = RGB::Blue, PointWidth = 50)
                             plot::Point(1, 2)
      
                             plot::Point(3, 1)

To plot these two points in a graphical scene, enter:

>> plot(p1, p2)

Scene options may be given to the call of plot, such as changing the style of the axes and drawing grid lines in the background of the plot:

>> plot(p1, p2, Axes = Box, GridLines = Automatic)

Example 2

Objects of the domain plot::Point, and objects of the basic domain DOM_POINT are graphical primitives for two- or three dimensional points. The main difference between objects of these two domains is, that objects of plot::Point can be used together with other graphical primitives of the library plot such as function graphs, surface plots, point-list plots, and more.

To ease the use of such different objects, you can easily convert objects of one domain into the other. For example, an object of the domain plot::Point such as:

>> p := plot::Point([1, 2])
                             plot::Point(1, 2)

can be converted into the domain DOM_POINT as follows:

>> plot::Point::convert_to(p, DOM_POINT)
                              point(1.0, 2.0)

Note that because objects of the domain DOM_POINT only know the plot option Color, any other plot option set for the object p is lost by this conversion.

With the method "convert", objects can be converted into the domain plot::Point. For example, we convert the list [1, 2, 3] into the point (1; 2; 3) as an object of the domain plot::Point:

>> l := [1, 2, 3]: p:= plot::Point::convert(l)
                           plot::Point(1, 2, 3)

One may now override default values of some plot options for the object p as follows:

>> p::Color := RGB::Blue: p::PointWidth := 50:
   plot(p, Axes = None)

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000