Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.


plot::Scene3d(object3d1, object3d2, …, <a = amin .. amax>, options)


plot::Scene3d 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 plot(object1, object2,...) creates a default scene object implicitly to display the graphical objects in. You must create scene objects explicitly 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 3D scene object is a container for coordinate systems of type plot::CoordinateSystem3d. However, you can ignore this technicality because a suitable default coordinate system is created internally, when graphical primitives are passed to plot::Scene3d.

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 let you:

  • Set annotations (Header, Footer) and control the Legend.

  • Set layout parameters such as height and width if the canvas attribute Layout is set to Absolute or Relative.

  • Set a direction for the automatic camera in 3D by using CameraDirection.

  • Set various style parameters, such as BackgroundColor.

A complete listing of the attributes associated with a 3D 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 can contain more than one graphical scene. In this case, create separate scene objects explicitly and pass them to a plot command or insert them 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.


AttributePurposeDefault Value
BackgroundColorbackground colorRGB::White
BackgroundColor2second background color for color blendsRGB::Grey75
BackgroundStylecolor blends in the backgroundFlat
BackgroundTransparentplot a scene on a transparent backgroundFALSE
BorderColorcolor of frame/border around canvas and scenesRGB::Grey50
BorderWidthwidth of frame/border around canvas and scenes0
Bottomdistance of bottom of scene to bottom of canvas0
BottomMarginbottom margin width1
CameraDirectionthe direction of the automatic camera 
CameraDirectionXthe direction of the automatic camera, x-component 
CameraDirectionYthe direction of the automatic camera, y-component 
CameraDirectionZthe direction of the automatic camera, z-component 
Footerfooter text 
FooterFontfont of footers (scene and canvas)[" sans-serif ", 12]
FooterAlignmentalignment of footer of canvas and scenesCenter
Headerheader text 
HeaderFontfont of headers (scene and canvas)[" sans-serif ", 12]
HeaderAlignmentalignment of header of canvas and scenesCenter
Heightheights of canvas/scenes80
Leftdistance of left of scene to left of canvas0
LeftMarginleft margin width1
LegendFontfont of legend entries[" sans-serif ", 8]
LegendVisibleswitch legend on/offFALSE
LegendPlacementlegend above or belowBottom
LegendAlignmentlegend at left, center, or rightCenter
Lightinglight schemes for 3D graphicsAutomatic
Marginmargins around canvas and scenes1
Namethe name of a plot object (for browser and legend) 
RightMarginright margin width1
TopMargintop margin width1
Widthwidths of canvas/scenes120
YXRatioscaling ratio between y and x axes1
ZXRatioscaling ratio between z and x axes2/3


Example 1

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 scene displays 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:


object3d1, object3d2, …

3D coordinate systems or graphical 3D objects

See Also

MuPAD Functions

MuPAD Graphical Primitives

Was this topic helpful?