feather
Arrows from x-axis
Description
feather(
plots arrows using the complex values specified byZ
)Z
, with the real part indicating thex-components and the imaginary part indicating they-components. This syntax is equivalent tofeather(real(Z),imag(Z))
.
f = feather(___)
returns a vector ofLine
objects withlength(U)+1
elements. The firstlength(U)
elements represent individual arrows, and the last element represents a horizontal line along thex-axis. Use theseLine
objects to control the appearance of the plot after creating it.
Examples
Create Feather Plot Using Cartesian Values
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)
Create Feather Plot Using Polar Values
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 thepol2cart
function. Then, create the plot.
th = -pi/2:pi/16:0; r = 10*ones(size(th)); [u,v] = pol2cart(th,r); feather(u,v)
Create Feather Plot Using Complex Values
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)
Specify Color of Feather Plot
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')
Specify Line Width and Color of One Arrow
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 ofLine
objects.
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 ofu
andv
. Then, change the line width and color.
f1 = f(1); f1.Color ='r'; f1.LineWidth = 2;
Specify Axes for Feather Plot
Starting in R2019b, you can display a tiling of plots using thetiledlayout
andnexttile
functions. Call thetiledlayout
function to create a 1-by-2 tiled chart layout. Call thenexttile
function to create an axes object and return the object asax1
. Create the left plot by passingax1
to thefeather
function. Add a title to the plot by passing the axes to thetitle
function. 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')
输入参数
Z
—Complex values
scalar|vector|matrix
Complex values, specified as a scalar, vector, or matrix. The real part ofZ
indicates thex-components of arrows, and the imaginary part indicates they-components.
LineSpec
—Line style, marker, and color
string|character vector
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 |
|
"--" |
Dashed line |
|
":" |
Dotted line |
|
"-." |
Dash-dotted line |
|
Marker | Description | Resulting Marker |
---|---|---|
"o" |
Circle |
|
"+" |
Plus sign |
|
"*" |
Asterisk |
|
"." |
Point |
|
"x" |
Cross |
|
"_" |
Horizontal line |
|
"|" |
Vertical line |
|
"square" |
Square |
|
"diamond" |
Diamond |
|
"^" |
Upward-pointing triangle |
|
"v" |
Downward-pointing triangle |
|
">" |
Right-pointing triangle |
|
"<" |
Left-pointing triangle |
|
"pentagram" |
Pentagram |
|
"hexagram" |
Hexagram |
|
Color Name | Short Name | RGB Triplet | Appearance |
---|---|---|---|
"red" |
"r" |
[1 0 0] |
|
"green" |
"g" |
[0 1 0] |
|
"blue" |
"b" |
[0 0 1] |
|
"cyan" |
"c" |
[0 1 1] |
|
"magenta" |
"m" |
[1 0 1] |
|
"yellow" |
"y" |
[1 1 0] |
|
"black" |
"k" |
[0 0 0] |
|
"white" |
"w" |
[1 1 1] |
|
ax
—Target axes
Axes
object
Target axes, specified as anAxes
object.
Extended Capabilities
GPU Arrays
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
Usage notes and limitations:
This function accepts GPU arrays, but does not run on a GPU.
For more information, seeRun MATLAB Functions on a GPU(Parallel Computing Toolbox).
Distributed Arrays
Partition large arrays across the combined memory of your cluster using Parallel Computing Toolbox™.
Usage notes and limitations:
This function operates on distributed arrays, but executes in the client MATLAB®.
For more information, seeRun MATLAB Functions with Distributed Arrays(Parallel Computing Toolbox).
Version History
Introduced before R2006a
Open Example
你有这个的修改版本s example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina(Español)
- Canada(English)
- United States(English)
Europe
- Belgium(English)
- Denmark(English)
- Deutschland(Deutsch)
- España(Español)
- Finland(English)
- France(Français)
- Ireland(English)
- Italia(Italiano)
- Luxembourg(English)
- Netherlands(English)
- Norway(English)
- Österreich(Deutsch)
- Portugal(English)
- Sweden(English)
- Switzerland
- United Kingdom(English)