| Description |
GRIDXY - Plot grid lines
GRIDXY(X) plots vertical grid lines at the positions specified by X. GRIDXY(X,Y) also plots horizontal grid lines at the positions specified by Y. GRIDXY uses the current axes, if any. Lines outside the plot area are plotted but not shown. When X or Y is empty no vertical or horizontal lines are plotted.
The lines are plotted as a single graphics object. H = GRIDXY(..) returns a graphics handle to that line object.
GRIDXY(..., '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.
Examples
% some random plot
plot(10*rand(100,1), 10*rand(100,1),'bo') ;
% horizontal red dashed grid
gridxy([1.1 3.2 4.5],'Color','r','Linestyle',':') ;
% vertical solid thicker yellowish grid, and store the handle
h = gridxy([],[2.1:0.7:5 8],'Color',[0.9 1.0 0.2],'linewidth',3) ;
GRIDXY can be used to plot a irregular grid on the axes.
NOTE: This file was previously known as XYREFLINE. I have changed the name to avoid a naming confusion with another function I have created.
Current version 2.2 (feb 2008) |