sgrid.m
来自「基于Matlab的地震数据处理显示和测井数据显示于处理的小程序」· M 代码 · 共 72 行
M
72 行
function aux=sgrid(d,type,color,lw)% Function plots grid lines at coordinate(s) d%% Written by: E. R.% Last updated: March 9, 2004: make handle of grid invisible so that it is not % used by the "legend" command% % aux=sgrid(d,type,color,lw)% INPUT% d array denoting the location of grid lines% grid line locations outside the range of axis values are discarded% type string variable% 'v' vertical lines% 'h' horizontal lines% color Color and style of the lines (default: color='k-')% lw Line width (default: lw=1)%% See also SGRID1% OUTPUT% aux structure with auxiliary information% 'handles' handles of the grid linesif nargin < 3 color='k'; linestyle='-'; lw=1;else if length(color) > 1 linestyle=color(2:end); else linestyle='-'; end color=color(1);endif nargin < 4 lw=1;endif isempty(color), color='k'; linestyle='-';end hold onv=axis;% nl=length(d);if strcmp(type,'v') == 1% idx=find(d >= v(1) & d <=v(2)); x=d(d >= v(1) & d <=v(2)); handles=zeros(length(x),1); for ii=1:length(x); handles(ii)=line([x(ii),x(ii)],[v(3),v(4)],'Color',color,'LineStyle', ... linestyle,'LineWidth',lw); endelseif strcmp(type,'h') == 1% idx=find(d >= v(3) & d <=v(4)); x=d(d >= v(3) & d <= v(4)); handles=zeros(length(x),1); for ii=1:length(x); handles(ii)=line([v(1),v(2)],[x(ii),x(ii)],'Color',color,'LineStyle', ... linestyle,'LineWidth',lw); endelse error('Unknown argument type')endset(handles,'HandleVisibility','off')if nargout == 1 aux.handles=handles;end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?