timestamp.m
来自「基于Matlab的地震数据处理显示和测井数据显示于处理的小程序」· M 代码 · 共 127 行
M
127 行
function timeStamp% Function creates time stamp and possibly a label on plot% Time used is in S4M.time, label is in S4M.plot_label.% default (value of global variable S4M.time (if given) or result of call to datum% Written by: E. R.: November 4, 2005% Last updated: November 28, 2005: Slight change in x-location of the % time-stamp annotation%% timeStamp% INPUT% location location of time stamp. Possible values are "top" and 'bottom'.% Default: 'bottom'global S4Mif isempty(S4M) presetsendfigure_handle=gcf;axis_handle=gca; % Save handle to current axesif strcmp(get(figure_handle,'PaperOrientation'),'landscape') time_stamp_l('bottom')else time_stamp_p('bottom')end axes(axis_handle); % Make original axes the current axes%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function time_stamp_l(location)% Function creates time stamp and possibly a label on plot% Time used is in S4M.time, label is in S4M.plot_label.% default (value of global variable S4M.time (if given) or result of call to datum% Written by: E. R.: 1995% Last updated: September 13, 2004: change handle visibilty to "off"%% time_stamp(location)% INPUT% location location of time stamp. Possible values are "top" and 'bottom'.% Default: 'bottom'global PARAMS4PROJECT S4M WF h=axes('Position',[0 0 1 1],'Visible','off');if nargin == 0 location='bottom';end% Add date/time stamp xt=0.80;if strcmp(location,'top') yt=0.95; else yt=0.02; endtext(xt,yt,S4M.time,'FontSize',7); xt=0.1;txt=strrep(S4M.plot_label,'_','\_');if ~isempty(PARAMS4PROJECT) & isfield(PARAMS4PROJECT,'name') & ~isempty(txt) txt={strrep(PARAMS4PROJECT.name,'_','\_');txt};elseif ~isempty(WF) & ~isempty(txt) txt={strrep(WF.name,'_','\_');txt};endif strcmp(location,'top') yt=0.95;else yt=0.027;endtext(xt,yt,txt,'FontSize',6);set(h,'HandleVisibility','off');%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function time_stamp_p(location)% Function creates time stamp and possibly program stamp on plot% date date for time stamp (e.g. result of call to datum)% default (value of global variable TIME (if given) or result of call to datum% if global string variable PROGRAM is also set, the string PROGRAM is also % written to the plot% Last updated: September 13, 2004: change handle visibilty to "off"global PARAMS4PROJECT S4M WFh=axes('Position',[0 0 1 1],'Visible','off');if nargin == 0 location='bottom';end% Add date/time stamp xt=0.75;if strcmp(location,'top') yt=0.94; else yt=0.02; endtext(xt,yt,S4M.time,'FontSize',6); txt=strrep(S4M.plot_label,'_','\_');if ~isempty(PARAMS4PROJECT) & isfield(PARAMS4PROJECT,'name') & ~isempty(txt) txt={strrep(PARAMS4PROJECT.name,'_','\_');txt};elseif ~isempty(WF) & ~isempty(txt) txt={strrep(WF.name,'_','\_');txt};endxt=0.09;if strcmp(location,'top') yt=0.94;else yt=0.02;endtext(xt,yt,txt,'FontSize',6); set(h,'HandleVisibility','off');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?