plotv
(To be removed) Plot vectors as lines from origin
plotv
will be removed in a future release. Use plot
instead. For information on updating your code, see Version History (since R2023a)
Syntax
Description
Examples
Plot Vectors Using the plotv
Function
This example shows how to plot three 2-element vectors.
M = [-0.4 0.7 0.2 ;
-0.5 0.1 0.5];
plotv(M,'-')
Input Arguments
M
— Matrix to plot
matrix
Matrix of column vectors to plot, specified as a
R
-by-Q
matrix of Q
column vectors
with R
elements.
R
must be 2 or greater. If R
is greater than 2,
this function only uses the first two rows of M
for the plot.
T
— Line plotting type
character vector | string
Line style, marker, and color, specified as a character vector or string 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 nodes and no edges between them.
Example: '--or'
is a red dashed line with circle
markers.
Line Style | Description |
---|---|
- | Solid line (default) |
-- | Dashed line |
: | Dotted line |
-. | Dash-dot line |
Marker | Description |
---|---|
o | Circle |
+ | Plus sign |
* | Asterisk |
. | Point |
x | Cross |
s | Square |
d | Diamond |
^ | Upward-pointing triangle |
v | Downward-pointing triangle |
> | Right-pointing triangle |
< | Left-pointing triangle |
p | Pentagram |
h | Hexagram |
Color | Description |
---|---|
| Yellow |
| Magenta |
| Cyan |
| Red |
| Green |
| Blue |
| White |
| Black |
Version History
Introduced before R2006aR2023a: To be removed
plotv
will be removed. Use plot
instead. The plot
function offers greater flexibility
over figure properties and is consistent with other MATLAB® plotting functions.
There are several differences between these functions that require updates to your code.
For example, let M
be a matrix containing three 2-element
vectors.
M = [-0.4 0.7 0.2 ; -0.5 0.1 0.5];
Using plotv | Using plot |
---|---|
plotv(M,'-') |
origin = zeros(1,size(M,2)); plot([origin; M(1,:)],[origin; M(2,:)]); |
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)