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.


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::Arrow2d(<[x1, y1]>, [x2, y2], <a = amin .. amax>, options)


plot::Arrow2d([x1, y1], [x2, y2]) creates a 2D arrow from the point (x1, y1) to the point (x2, y2).

plot::Arrow2d([x2, y2]) creates a 2D arrow from the point (0, 0) to the point (x2, y2).

The points defining an arrow can also be passed as vectors.

The appearance of arrows can be controlled by various attributes:


AttributePurposeDefault Value
AffectViewingBoxinfluence of objects on the ViewingBox of a sceneTRUE
AntiAliasedantialiased lines and points?TRUE
Colorthe main colorRGB::Blue
Framesthe number of frames in an animation50
Fromstarting point of arrows and lines[0, 0]
FromXstarting point of arrows and lines, x-coordinate0
FromYstarting point of arrows and lines, y-coordinate0
Legendmakes a legend entry 
LegendTextshort explanatory text for legend 
LegendEntryadd this object to the legend?FALSE
LineColorcolor of linesRGB::Blue
LineWidthwidth of lines0.35
LineStylesolid, dashed or dotted lines?Solid
LineColorDirectionthe direction of color transitions on lines[0, 1]
LineColorDirectionXx-component of the direction of color transitions on lines0
LineColorDirectionYy-component of the direction of color transitions on lines1
Namethe name of a plot object (for browser and legend) 
ParameterEndend value of the animation parameter 
ParameterNamename of the animation parameter 
ParameterBegininitial value of the animation parameter 
ParameterRangerange of the animation parameter 
TimeEndend time of the animation10.0
TimeBeginstart time of the animation0.0
TimeRangethe real time span of an animation0.0 .. 10.0
TipAngleopening angle of arrow heads(2*PI)/15
TipStylepresentation style of arrow headsFilled
TipLengthlength of arrow heads4
Titleobject title 
TitleFontfont of object titles[" sans-serif ", 11]
TitlePositionposition of object titles 
TitleAlignmenthorizontal alignment of titles w.r.t. their coordinatesCenter
TitlePositionXposition of object titles, x component 
TitlePositionYposition of object titles, y component 
Toend point of arrows and lines[1, 0]
ToXend point of arrows and lines, x-coordinate1
ToYend point of arrows and lines, y-coordinate0
VisibleAfterobject visible after this time value 
VisibleBeforeobject visible until this time value 
VisibleFromToobject visible during this time range 
VisibleAfterEndobject visible after its animation time ended?TRUE
VisibleBeforeBeginobject visible before its animation time starts?TRUE


Example 1

Create and plot the following arrows:

plot(plot::Arrow2d([1, 1]), plot::Arrow2d([1, 3]),
     plot::Arrow2d([1, 1], [1, 3]))

Various attributes are available to control the presentation style of an arrow:

plot(plot::Arrow2d([1, 1], Color = RGB::Red, 
                   TipStyle = Open, TipLength = 10*unit::mm), 
     plot::Arrow2d([-1, 1], Color = RGB::Green, 
                   LineWidth = 0.8*unit::mm,
                   TipStyle = Closed, TipAngle = PI/2), 
     plot::Arrow2d([0, -sqrt(2)], Color = RGB::Blue, 
                   LineStyle = Dashed), 
     Axes = None)

Example 2

Plot an arrow with fixed starting point and animated end point:

plot(plot::Circle2d(2, [1, 2]),
     plot::Arrow2d([1, 2], [1 + 2*cos(a), 2 + 2*sin(a)], 
                   a = 0..2*PI))


x1, y1

The coordinates of the starting point: real numerical values or arithmetical expressions of the animation parameter a. If no starting point is specified, an arrow starting at the origin is created.

x1, y1 are equivalent to the attributes FromX, FromY.

x2, y2

The coordinates of the end point: real numerical values or arithmetical expressions of the animation parameter a.

x2, y2 are equivalent to the attributes ToX, ToY.


Animation parameter, specified as a = amin..amax, where amin is the initial parameter value, and amax is the final parameter value.

See Also

MuPAD Functions

MuPAD Graphical Primitives

Was this topic helpful?