This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Groups of 2D objects

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.


plot::Group2d(object2d1, object2d2, …, <a = amin .. amax>, options)


plot::Group2d forms a group of any number of graphical 2D objects.

Grouping together a larger number of graphical objects and accessing the group as a whole simplifies their handling. In particular, the main purpose of a group is to inherit graphical attributes that are shared by all members of the group.

To change the inherited attributes interactively, do not select the group itself in the interactive object browser of the MuPAD® graphics tool (see Viewer, Browser, and Inspector: Interactive Manipulation). Underneath the group object, find 'defaults' branches for the objects in the group. Select the 'defaults' branch for the object type that you want to set attributes for.

A group can contain groups.

    Note:   When working with groups of points, the more efficient approach is to use the specialized grouping construct plot::PointList2d instead of generic groups of points.


AttributePurposeDefault Value
Namethe name of a plot object (for browser and legend) 


Example 1

Consider a group G1 consisting of two triangles inscribed in an ellipse. Form a new group G2 consisting of the group G1, the ellipse and its focal points. The entire figure given by the group G2 is rotated by an animated plot::Rotate2d:

G1 := plot::Group2d(
  plot::Polygon2d([[0, -1], [0, 1], [-2, 0]]),
  plot::Polygon2d([[0, -1], [0, 1], [ 2, 0]]),
  Closed = TRUE, Filled = TRUE, Color = RGB::Blue):
G2 := plot::Group2d(
  plot::Ellipse2d(2, 1,[0, 0]),
  plot::PointList2d([[-sqrt(3), 0], [sqrt(3), 0]]),
  PointSize = 2*unit::mm,
  PointColor = RGB::Red,
  LineColor = RGB::Black):
plot(plot::Rotate2d(a, [0, 0], a = 0..2*PI, G2))

delete G1, G2:


object2d1, object2d2, …

Graphical 2D objects

See Also

MuPAD Functions

MuPAD Graphical Primitives

More About

Was this topic helpful?