Main Content

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)

Description

plotv(M,T) takes a matrix of column vectors, M, and the line plotting type, T, and plots the column vectors of M.

example

Examples

collapse all

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

collapse all

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.

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 StyleDescription
-Solid line (default)
--Dashed line
:Dotted line
-.Dash-dot line
MarkerDescription
oCircle
+Plus sign
*Asterisk
.Point
xCross
sSquare
dDiamond
^Upward-pointing triangle
vDownward-pointing triangle
>Right-pointing triangle
<Left-pointing triangle
pPentagram
hHexagram
ColorDescription

y

Yellow

m

Magenta

c

Cyan

r

Red

g

Green

b

Blue

w

White

k

Black

Version History

Introduced before R2006a

collapse all

R2023a: 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];
Plot the column vectors as lines from the origin.

Using plotvUsing plot
plotv(M,'-')
origin = zeros(1,size(M,2)); 
plot([origin; M(1,:)],[origin; M(2,:)]); 

See Also

| |