h = vline([ax], x, [linetype], [lbl])
Draws a vertical line on the current axes at the location specified by x. The line is held on the current axes, and after plotting the line, the function returns the axes to its prior hold state. The HandleVisibility property of the line object is set to "off", so not only does it not appear on legends, but it cannot be found by using findobj. Specifying an output argument causes the function to return a handle to the line, so it can be manipulated or deleted.
Parameters |
Description |
ax [handle] |
(Optional) Axis handle. Defaults to current axes. |
x [vector] |
X-axis values for vertical lines |
linetype [char/cell] |
(Optional) Simple line spec for the line color, style and symbol. Defaults to 'r:'. Can pass in a cell array of strings if x is a vector. |
lbl [char/cell] |
(Optional) Text label for each line. Will be the same color as the line. If not passed in, lines will have no label. |
Return Values |
Description |
h [handle] |
Handles for each line plotted |
>> h = vline(42,'g','The Answer')
Copyright (c) 2009. All rights reserved.
|
What do you think about this topic? Send feedback!
|