Documentation Center

  • Trial Software
  • Product Updates

plot::CoordinateSystem2d

Coordinate system to display 2D objects in

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

plot::CoordinateSystem2d(object1, object2, …, <a = amin .. amax>, options)

Description

plot::CoordinateSystem2d is a container to display graphical 2D objects within. Usually, the user does not need to create such an object explicitly, because a plot command such as plot(object1, object2, …) creates a default object of type plot::CoordinateSystem2d implicitly to display the graphical objects in.

The plot::CoordinateSystem2d object is always visible in the interactive object browser of the MuPAD® graphics tool (see Viewer, Browser, and Inspector: Interactive Manipulation of this document). It contains the graphical objects as its children. When the coordinate system object is selected, it provides access to a variety of attributes that are associated with the coordinate system. These attributes allow to manipulate:

  • the CoordinateType (linear vs. logarithmic coordinates),

  • the ViewingBox (visibility range),

  • the coordinate axes (axes titles, visibility, alignment, type, tips etc.),

  • the ticks along the coodinate axes (number of tick marks, visibility, tick labels etc.),

  • the coordinate grid (visibility, color, line width etc.),

  • the scaling ratios of the coordinate directions (Constrained vs. UnConstrained).

A complete listing of the attributes associated with the coordinate system is given below. Follow the links to the help pages of the attributes to find more detailed information.

Apart from these attributes of the coordinate system, also attributes for the graphical objects inside the coordinate system can be specified when generating an object of type plot::CoordinateSystem2d. These attribute values are inherited to the graphical objects as new default values.

A graphical scene may contain more than one coordinate system. Each coordinate system provides separate coordinate axes, ticks, grid lines etc.

In such a case, separate plot::CoordinateSystem2d containers must be created explicitly by the user and passed to a plot command (or inserted into a scene of type plot::Scene2d). Cf. Example 2.

Attributes

AttributePurposeDefault Value
Axestype of the coordinate axesAutomatic
AxesTipsarrow tips at the coordinate axes?TRUE
AxesOrigincrosspoint of the coordinate axes[0, 0]
AxesTitlestitles for the coordinate axes[" x ", " y "]
AxesInFrontcoordinate axes in front of or behind graphical objects?FALSE
AxesOriginXcrosspoint of the coordinate axes, x-coordinate0
AxesOriginYcrosspoint of the coordinate axes, y-coordinate0
AxesVisibledisplay coordinate axes?TRUE
AxesLineColorcolor of the coordinate axesRGB::Black
AxesLineWidthwidth of the coordinate axes0.18
AxesTitleFontfont of axes titles[" sans-serif ", 10]
AxesTitleAlignmentalignment of axes titlesEnd
CoordinateTypelinear versus logarithmic plots in 2DLinLin
GridInFrontcoordinate grid in front of or behind graphical objects?FALSE
GridVisibledisplay a coordinate grid?FALSE
GridLineColorline color of the coordinate gridRGB::Grey60
GridLineWidthwidth of coordinate grid lines0.1
GridLineStyleline style of the coordinate gridSolid
Namethe name of a plot object (for browser and legend) 
Scalingscaling ratiosUnconstrained
SubgridVisibledisplay a coordinate subgrid?FALSE
SubgridLineColorline color of the coordinate subgridRGB::Grey80
SubgridLineWidthwidth of coordinate subgrid lines0.1
SubgridLineStyleline style of the coordinate subgridSolid
TicksAtspecial axes tick marks 
TicksAnchoruser defined start of axes tick marks0
TicksLengthlength of axes tick marks2
TicksNumbernumber of axes tick marksNormal
TicksBetweennumber of minor (unlabeled) axes tick marks between major (labeled) axes tick marks1
TicksVisibledisplay axes tick marks?TRUE
TicksDistanceuser defined axes tick mark distance0
TicksLabelFontfont of tick labels[" sans-serif ", 8]
TicksLabelStyledisplay style of axes tick labelsHorizontal
TicksLabelsVisibledisplay axes tick labels?TRUE
ViewingBoxthe visible coordinate range[Automatic .. Automatic, Automatic .. Automatic]
ViewingBoxXMinthe smallest visible x-valuesAutomatic
ViewingBoxYMinthe smallest visible y-valuesAutomatic
ViewingBoxXMaxthe largest visible x-valuesAutomatic
ViewingBoxYMaxthe largest visible y-valuesAutomatic
ViewingBoxXRangethe range of x-values visibleAutomatic .. Automatic
ViewingBoxYRangethe range of y-values visibleAutomatic .. Automatic
XAxisTitletitle for the x axis" x "
XAxisVisibledisplay x axis?TRUE
XAxisTitleAlignmentalignment of x axis titleEnd
XGridVisibledisplay a coordinate grid in x-direction?FALSE
XSubgridVisibledisplay a coordinate subgrid in x-direction?FALSE
XTicksAtspecial x axis tick marks 
XTicksAnchoruser defined start of x axis tick marks0
XTicksNumbernumber of x axis tick marksNormal
XTicksBetweennumber of minor (unlabeled) x axis tick marks between major (labeled) x axis tick marks1
XTicksVisibledisplay x axis tick marks?TRUE
XTicksDistancedistance of tick marks on x axis0
XTicksLabelStyledisplay style of x axis tick labelsHorizontal
XTicksLabelsVisibledisplay x axis tick labels?TRUE
YAxisTitletitle for the y axis" y "
YAxisVisibledisplay y axis?TRUE
YAxisTitleAlignmentalignment of y axis titleEnd
YAxisTitleOrientationorientation of the vertical axis title in 2DHorizontal
YGridVisibledisplay a coordinate grid in y-direction?FALSE
YSubgridVisibledisplay a coordinate subgrid in y-direction?FALSE
YTicksAtspecial y axis tick marks 
YTicksAnchoruser defined start of y axis tick marks0
YTicksNumbernumber of y axis tick marksNormal
YTicksBetweennumber of minor (unlabeled) y axis tick marks between major (labeled) y axis tick marks1
YTicksVisibledisplay y axis tick marks?TRUE
YTicksDistancedistance of tick marks on y axis0
YTicksLabelStyledisplay style of y axis tick labelsHorizontal
YTicksLabelsVisibledisplay y axis tick labels?TRUE

Examples

Example 1

When executing a plot command, a default plot::CoordinateSystem2d is created implicitly which contains the specified graphical objects:

f := plot::Function2d(sin(x)^2, x = -PI..PI):
g := plot::Function2d(cos(x)^2, x = -PI..PI):
plot(f, g)

We can also create the coordinate system explicitly. The result is the same:

plot(plot::CoordinateSystem2d(f, g))

delete f, g:

Example 2

We present the yearly sales of pears and apples in one scene. Different coordinate systems are used to obtain separate axes. We set various attributes to determine the positioning of the axes and their titles:

pears := plot::Polygon2d(
           [[1998, 1.2], [1999, 1.4], [2000, 1.5], 
            [2001, 1.7], [2002, 2.1], [2003, 1.98]],
           Color = RGB::Red, Title = "pears",
           TitlePosition = [2000, 1.6],
           TitleFont = [RGB::Red]):
apples := plot::Polygon2d(
            [[1998, 10.2], [1999, 14.4], [2000, 17.5], 
             [2001, 16.8], [2002, 18.0], [2003, 18.5]],
            Color = RGB::Blue, Title = "apples",
            TitlePosition = [2000, 18.0],
            TitleFont = [RGB::Blue]):

CS1 := plot::CoordinateSystem2d(pears):
CS1::AxesOriginX := 1998:
CS1::ViewingBox := [1998..2003, 0..2.5]:
CS1::AxesTitleFont := [RGB::Red]:
CS1::XAxisTitle := "year":
CS1::YAxisTitle := "pears":

CS2 := plot::CoordinateSystem2d(apples):
CS2::AxesOriginX := 2003:
CS2::ViewingBox := [1998..2003, 0..20]:
CS2::AxesTitleFont := [RGB::Blue]:
CS2::XAxisTitle := "year":
CS2::YAxisTitle := "apples":
plot(CS1, CS2, Axes = Origin, YAxisTitleAlignment = Center,
     YAxisTitleOrientation = Vertical)

delete pears, apples, CS1, CS2:

Parameters

object1, object2, …

Graphical 2D objects

See Also

MuPAD Functions

MuPAD Graphical Primitives

Was this topic helpful?