time | Calls | line |
---|
| | 1 | function hAxOut = legendcolorbarlayout(hAx,action,varargin)
|
| | 2 | %LEGENDCOLORBARLAYOUT Layout legend and/or colorbar around axes
|
| | 3 | % This is a helper function for legend and colorbar. Do not call
|
| | 4 | % directly.
|
| | 5 |
|
| | 6 | % LEGENDCOLORBARLAYOUT(AX,'addToTree',h) adds h as a child of the layout
|
| | 7 | % manager, but does not add h to the inner or outer list. The position
|
| | 8 | % of h will not be managed by the layout manager.
|
| | 9 | % LEGENDCOLORBARLAYOUT(AX,'addToLayout',h) adds h to the end of the
|
| | 10 | % layout list.
|
| | 11 |
|
| | 12 | % Copyright 1984-2018 The MathWorks, Inc.
|
| | 13 |
|
| | 14 | % First, make sure we have a valid axes:
|
< 0.001 | 16 | 15 | if ~isvalid(hAx) || ~(isgraphics(hAx,'axes') || isgraphics(hAx,'polaraxes') || isgraphics(hAx,'geoaxes'))
|
| | 16 | error(message('MATLAB:scribe:legendcolorbarlayout:InvalidAxes'));
|
< 0.001 | 16 | 17 | end
|
| | 18 |
|
0.002 | 16 | 19 | if isa(hAx.Parent, 'matlab.graphics.layout.Layout')
|
| | 20 | if nargout > 0
|
| | 21 | hAxOut = hAx;
|
| | 22 | obj = varargin{1};
|
| | 23 | obj.Parent = hAx.Parent;
|
| | 24 | end
|
< 0.001 | 16 | 25 | else
|
| | 26 |
|
0.077 | 16 | 27 | hManager = matlab.graphics.shape.internal.AxesLayoutManager.getManager(hAx);
|
| | 28 |
|
< 0.001 | 16 | 29 | if nargout > 0
|
< 0.001 | 8 | 30 | hAxOut = hManager.Axes;
|
< 0.001 | 16 | 31 | end
|
| | 32 |
|
< 0.001 | 16 | 33 | switch action
|
< 0.001 | 16 | 34 | case 'addToTree'
|
0.080 | 8 | 35 | hManager.addToTree(varargin{1});
|
< 0.001 | 8 | 36 | case 'addToLayout'
|
0.003 | 8 | 37 | hManager.addToLayout(varargin{1});
|
< 0.001 | 16 | 38 | end
|
< 0.001 | 16 | 39 | end
|
Other subfunctions in this file are not included in this listing.