This functionality does not run in MATLAB.
plot::Scene2d(object2d1, object2d2, …, <a = amin .. amax>, options)
plot::Scene2d is a container to display one or more coordinate systems containing graphical objects. Scene objects must be created when several graphical scenes are to be displayed simultaneously in a plot.
Usually, you do not need to create a scene object explicitly, because a plot command such as plot(object1, object2, …) creates a default scene object implicitly to display the graphical objects in.
The need for creating scene objects explicitly arises only when several scenes are to be displayed simultaneously in one plot.
The MuPAD® graphics makes a clear division between 2D and 3D. Scene objects of type plot::Scene2d do not accept 3D objects and plot::Scene3d objects do not accept 2D objects. When several scenes are displayed simultaneously in a single plot, all scenes must be of the same dimension.
Strictly speaking, a 2D scene object is a container for coordinate systems of type plot::CoordinateSystem2d. However, you do not have to bother about this technicality because a suitable default coordinate system is created internally, when graphical primitives are passed to plot::Scene2d.
Scene objects are always visible in the interactive object browser of the MuPAD graphics tool (see section Viewer, Browser, and Inspector: Interactive Manipulation of this document). Each scene contains one or more coordinate systems as its children. When the scene object is selected, it provides access to a variety of attributes that are associated with scenes. The scene attributes allow to
set layout parameters such as height and width (if the canvas attribute Layout is set to Absolute or Relative),
set various style parameters such as BackgroundColor etc.
A complete listing of the attributes associated with a 2D scene is given below. Follow the links to the help pages of the attributes to find more detailed information.
Apart from these attributes of the scene object, also attributes for the coordinate system and the graphical objects inside the scene can be specified when generating a scene object. These attribute values are inherited to the coordinate system and the graphical objects as new default values.
A plot may contain more than one graphical scene. In such a case, separate scene objects must be created explicitly by the user and passed to a plot command (or inserted into an object of type plot::Canvas). For details on the layout of scenes inside the drawing area ("canvas"), see the help page of the canvas attribute Layout.
See Example 1.
|BackgroundTransparent||plot a scene on a transparent background||FALSE|
|BorderColor||color of frame/border around canvas and scenes||RGB::Grey50|
|BorderWidth||width of frame/border around canvas and scenes||0|
|Bottom||distance of bottom of scene to bottom of canvas||0|
|BottomMargin||bottom margin width||1|
|FooterFont||font of footers (scene and canvas)||[" sans-serif ", 12]|
|FooterAlignment||alignment of footer of canvas and scenes||Center|
|HeaderFont||font of headers (scene and canvas)||[" sans-serif ", 12]|
|HeaderAlignment||alignment of header of canvas and scenes||Center|
|Height||heights of canvas/scenes||80|
|Left||distance of left of scene to left of canvas||0|
|LeftMargin||left margin width||1|
|LegendFont||font of legend entries||[" sans-serif ", 8]|
|LegendVisible||switch legend on/off||FALSE|
|LegendPlacement||legend above or below||Bottom|
|LegendAlignment||legend at left, center, or right||Center|
|Margin||margins around canvas and scenes||1|
|Name||the name of a plot object (for browser and legend)|
|RightMargin||right margin width||1|
|TopMargin||top margin width||1|
|Width||widths of canvas/scenes||120|
Scene objects have to be created explicitly only when several scenes are to be displayed simultaneously in one plot. The following call uses the automatic layout of several scenes in a canvas:
S1 := plot::Scene2d(plot::Function2d(sin(x), x = 0..2*PI), Header = "the sine function"): S2 := plot::Scene2d(plot::Function2d(cos(x), x = 0..2*PI), Header = "the cosine function"): S3 := plot::Scene2d(plot::Function2d(tan(x), x = 0..PI), Header = "the tan function"): S4 := plot::Scene2d(plot::Function2d(cot(x), x = 0..PI), Header = "the cot function"): plot(S1, S2, S3, S4, BorderWidth = 0.5*unit::mm)
We use the canvas attribute Layout = Relative to position 3 of these scenes in the canvas. The size of the scenes is set with the attributes Width and Height, specifying multiples of the canvas' width and height. The bottom left corner of each scene is positioned with the scene attributes Bottom and Left:
S1::Width := 0.475: S1::Height := 0.42: S2::Width := 0.475: S2::Height := 0.42: S3::Width := 0.475: S3::Height := 0.42: S1::Bottom := 0.46: S1::Left := 0.02: S2::Bottom := 0.02: S2::Left := 0.02: S3::Bottom := 0.26: S3::Left := 0.51: S3::HeaderFont := ["Times New Roman", Italic, 12]: plot(S1, S2, S3, Layout = Relative, BorderWidth = 0.5*unit::mm, plot::Scene2d::BorderWidth = 0.2*unit::mm, Header = "trigonometric functions", HeaderFont = ["Times New Roman", Bold, 18]):
delete S1, S2, S3, S4:
Conic sections are the curves that you get when intersecting a cone and a plane. The first scene displays a plane and a rotating cone, the second the corresponding conic section:
c := plot::Cone(1, [-sin(a), 0, -cos(a)], [sin(a), 0, cos(a)], a = 0..2*PI): s := plot::Surface([x, y, 0], x = -1..1, y = -1..1): S1 := plot::Scene3d(c, s): S2 := plot::Scene3d(c, ViewingBoxZRange = -0.01 .. 0.01): plot(S1, S2, Layout = Horizontal)
delete c, s, S1, S2:
object2d1, object2d2, …
2D coordinate systems or graphical 2D objects