gca.m
来自「matlab6.5」· M 代码 · 共 29 行
M
29 行
function h = gca(fig)
%GCA Get handle to current axis.
% H = GCA returns the handle to the current axis in the current
% figure. The current axis is the axis that graphics commands
% like PLOT, TITLE, SURF, etc. draw to if issued.
% Use the commands AXES or SUBPLOT to change the current axis
% to a different axis, or to create new ones.
%
% See also AXES, SUBPLOT, DELETE, CLA, HOLD, GCF, GCBO, GCO, GCBF.
% H = GCA(FIG) returns the handle to the current axis in the
% specified figure (it need not be the current figure).
%
% Copyright 1984-2002 The MathWorks, Inc.
% $Revision: 5.18 $ $Date: 2002/04/08 22:41:28 $
if nargin == 0
fig = gcf;
end
h = get(fig,'CurrentAxes');
% 'CurrentAxes' is no longer guaranteed to return an axes,
% so we might need to create one (because gca IS guaranteed to
% return an axes)
if isempty(h)
h = axes('parent',fig);
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?