sidetext.m

来自「一种新的时频分析方法的matlab源程序。」· M 代码 · 共 45 行

M
45
字号
function sidetext(string,p1,v1,p2,v2,p3,v3,p4,v4,p5,v5,p6,v6,p7,v7,p8,v8)
 
% The function SIDETEXT labels the right hand side of an axes for 2-D and 3-D plots.
% SIDETEXT('text') adds text beside the X-axis on the current axis.
%
% SIDETEXT('text', 'Property1',PropertyValue1,
%			 'Property2',PropertyValue2,...)
% sets the values of the specified properties of the sidetext.
%
% See also XLABEL, YLABEL, ZLABEL, TITLE, TEXT.
 
% Copyright (c) 1984-94 by The MathWorks, Inc.
% Patrick Marchand	15 Dec. 1995 Modified
%			( put text on side of axes).

ax = gca;
h = findobj(get(ax,'children'),'tag','side_text_string');

if h
  set(h,'string',string);
else
  h = text(1.05,0.5,string,'units','normalized','Vertical','middle',...
	'Horizontal','center','rotation',90,'tag','side_text_string');
end

%Over-ride text objects default font attributes with
%the Axes' default font attributes.
set(h, 'FontAngle',  get(ax, 'FontAngle'), ...
	'FontName',   get(ax, 'FontName'), ...
	'FontSize',   get(ax, 'FontSize'), ...
	'FontWeight', get(ax, 'FontWeight'), ...
	'string',     string);

if nargin > 1,
	if (nargin-1)/2-fix((nargin-1)/2),
		error('Incorrect number of input arguments')
	end
	cmdstr='';
	for i=1:(nargin-1)/2-1,
		cmdstr = [cmdstr,'p',num2str(i),',v',num2str(i),','];
	end
	cmdstr = [cmdstr,'p',num2str((nargin-1)/2),',v',num2str((nargin-1)/2)];
	eval(['set(h,',cmdstr,');']);
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?