Main Content

feather

Arrows from x-axis

  • Arrows along the x-axis

Description

example

feather(U,V)plots arrows originating from thex-axis. Specify the direction of arrows using the Cartesian componentsUandV, withUindicating thex-components andVindicating they-components. Thenth arrow has its base atnon thex-axis. The number of arrows matches the number of elements inUandV.

example

feather(Z)plots arrows using the complex values specified byZ, with the real part indicating thex-components and the imaginary part indicating they-components. This syntax is equivalent tofeather(real(Z),imag(Z)).

example

feather(___,LineSpec)sets the line style, marker symbol, and color for the arrows.

example

feather(ax,___)plots arrows in the specified axes instead of the current axes.

example

f = feather(___)returns a vector ofLineobjects withlength(U)+1elements. The firstlength(U)elements represent individual arrows, and the last element represents a horizontal line along thex-axis. Use theseLineobjects to control the appearance of the plot after creating it.

Examples

collapse all

Create a feather plot by specifying the components of each arrow as Cartesian values. Thenth arrow originates fromnon thex-axis.

t = -pi/2:pi/8:pi/2; u = 10*sin(t); v = 10*cos(t); feather(u,v)

Figure contains an axes object. The axes object contains 10 objects of type line.

Create a feather plot using polar coordinates by first converting them to Cartesian coordinates.

To do this, create vectors with polar coordinates. Convert them to Cartesian coordinates using thepol2cartfunction. Then, create the plot.

th = -pi/2:pi/16:0; r = 10*ones(size(th)); [u,v] = pol2cart(th,r); feather(u,v)

Figure contains an axes object. The axes object contains 10 objects of type line.

Create a vector of complex values. Then, display them using a feather plot. The real part determines thex-component of each arrow, and the imaginary part determines they-component.

Z = [2+3i -1-3i -1+i 2i 3-4i -2-2i -2+4i 0.5-i -3i 1+i]; feather(Z)

Figure contains an axes object. The axes object contains 11 objects of type line.

Create a feather plot with red arrows.

t = -pi/2:pi/8:pi/2; u = 10*sin(t); v = 10*cos(t); feather(u,v,'r')

Figure contains an axes object. The axes object contains 10 objects of type line.

Specify the line width and color of a single arrow by assigning the arrow to a variable and then setting its properties. To do this, first create a feather plot and return an array ofLineobjects.

t = -pi/2:pi/8:pi/2; u = 10*sin(t); v = 10*cos(t); f = feather(u,v);

Assign the first arrow to a variable. The first arrow corresponds to the first elements ofuandv. Then, change the line width and color.

f1 = f(1); f1.Color ='r'; f1.LineWidth = 2;

Figure contains an axes object. The axes object contains 10 objects of type line.

Starting in R2019b, you can display a tiling of plots using thetiledlayoutandnexttilefunctions. Call thetiledlayoutfunction to create a 1-by-2 tiled chart layout. Call thenexttilefunction to create an axes object and return the object asax1. Create the left plot by passingax1to thefeatherfunction. Add a title to the plot by passing the axes to thetitlefunction. Repeat the process to create the right plot.

tiledlayout(1,2)% Left plotax1 = nexttile; t = 0:pi/8:pi/2; u1 = 10*sin(t); v1 = 10*cos(t); feather(ax1,u1,v1) title(ax1,'Left Plot')% Right plotax2 = nexttile; u2 = zeros(5,1); v2 = [1 -2 3 -4 5]; feather(ax2,u2,v2) title(ax2,'Right Plot')

Figure contains 2 axes objects. Axes object 1 with title Left Plot contains 6 objects of type line. Axes object 2 with title Right Plot contains 6 objects of type line.

输入参数

collapse all

x-components, specified as a scalar, vector, or matrix. Specify Cartesian values. To convert data from polar to Cartesian, usepol2cart.

的size ofUmust match the size ofV.

y-components, specified as a scalar, vector, or matrix. Specify Cartesian values. To convert data from polar to Cartesian, usepol2cart.

的size ofVmust match the size ofU.

Complex values, specified as a scalar, vector, or matrix. The real part ofZindicates thex-components of arrows, and the imaginary part indicates they-components.

Line style, marker, and color, specified as a string or character vector containing symbols. The symbols can appear in any order. You do not need to specify all three characteristics (line style, marker, and color). For example, if you omit the line style and specify the marker, then the plot shows only the marker and no line.

Example:"--or"is a red dashed line with circle markers

Line Style Description Resulting Line
"-" Solid line

Sample of solid line

"--" Dashed line

样本的虚线

":" Dotted line

Sample of dotted line

"-." Dash-dotted line

Sample of dash-dotted line, with alternating dashes and dots

Marker Description Resulting Marker
"o" Circle

Sample of circle marker

"+" Plus sign

Sample of plus sign marker

"*" Asterisk

Sample of asterisk marker

"." Point

Sample of point marker

"x" Cross

Sample of cross marker

"_" Horizontal line

Sample of horizontal line marker

"|" Vertical line

Sample of vertical line marker

"square" Square

Sample of square marker

"diamond" Diamond

Sample of diamond line marker

"^" Upward-pointing triangle

Sample of upward-pointing triangle marker

"v" Downward-pointing triangle

Sample of downward-pointing triangle marker

">" Right-pointing triangle

Sample of right-pointing triangle marker

"<" Left-pointing triangle

Sample of left-pointing triangle marker

"pentagram" Pentagram

Sample of pentagram marker

"hexagram" Hexagram

Sample of hexagram marker

Color Name Short Name RGB Triplet Appearance
"red" "r" [1 0 0]

Sample of the color red

"green" "g" [0 1 0]

Sample of the color green

"blue" "b" [0 0 1]

Sample of the color blue

"cyan" "c" [0 1 1]

Sample of the color cyan

"magenta" "m" [1 0 1]

Sample of the color magenta

"yellow" "y" [1 1 0]

Sample of the color yellow

"black" "k" [0 0 0]

Sample of the color black

"white" "w" [1 1 1]

Sample of the color white

Target axes, specified as anAxesobject.

Extended Capabilities

Version History

Introduced before R2006a

See Also

Functions

Properties