REFLINEXY(X,Y) plots vertical and horizontal reference lines. The vertical set of lines are drawn from the bottom of the axes up to each point Y at the positions X. The horizontal set of lines are drawn from the left of the axes to each point X at the positions Y.
REFLINEXY(X,Y,XOFFSET) uses the value XOFFSET as the vertical offset for the vertical lines. REFLINE(X,Y,XOFFSET,YOFFSET) uses the value YOFFSET as the horizontal offset for the horizontal lines. If the offsets are omitted, or if they are empty, the defaults are used, namely the bottom and/or the left side of the axis, respectively. The offsets can be specified for each point separately.
The lines are plotted as a two graphics object. H = XYREFLINE(..) returns the two graphics handles of the vertical and horizontal line objects.
REFLINEXY(..., 'Prop1','Val1','Prop2','Val2', ...) uses the properties and values specified for color, linestyle, etc. Execute GET(H), where H is a line handle, to see a list of line object properties and their current values. Execute SET(H) to see a list of line object properties and legal property values.
REFLINEXY uses the current axes, if any. Lines outside the plot area are plotted but not shown.
% some data
N = 1000 ; i=0:N ;
x = (i/N) * 4 * pi ; y = exp(i/N) .* sin(x) ;
% add specific reference lines
i0 = [100 400 600] ;
% other reference lines with a specific offset
h = reflinexy(1:14,linspace(-2,1.5,14),,x(end)-2) ;
See also STEM, PLOT, REFLINE, GRID, AXES
and GRIDXY (on the FEX)
version 1.2 (april 19th, 2007)
Jos (10584) (2021). REFLINEXY (https://www.mathworks.com/matlabcentral/fileexchange/14706-reflinexy), MATLAB Central File Exchange. Retrieved .
Thanks Rick. Apparently the Mathworks has changed something in UISTACK since R13 ... I will update the file shortly.
I had to replace hxy with hxy(:) in line 139 to get it to work
Inspired by: GRIDXY
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!