time | Calls | line |
---|
| | 1 | function hh = zlabel(varargin)
|
| | 2 | %ZLABEL Z-axis label.
|
| | 3 | % ZLABEL('text') adds text beside the Z-axis on the current axes.
|
| | 4 | %
|
| | 5 | % ZLABEL('text','Property1',PropertyValue1,'Property2',PropertyValue2,...)
|
| | 6 | % sets the values of the specified properties of the zlabel.
|
| | 7 | %
|
| | 8 | % ZLABEL(AX,...) adds the zlabel to the specified axes.
|
| | 9 | %
|
| | 10 | % H = ZLABEL(...) returns the handle to the text object used as the label.
|
| | 11 | %
|
| | 12 | % See also XLABEL, YLABEL, TITLE, TEXT.
|
| | 13 |
|
| | 14 | % Copyright 1984-2019 The MathWorks, Inc.
|
| | 15 |
|
< 0.001 | 2 | 16 | if nargout>0
|
| | 17 | [isaxarr,hh]=matlab.graphics.chart.internal.objArrayDispatch(@zlabel,varargin{:});
|
< 0.001 | 2 | 18 | else
|
< 0.001 | 2 | 19 | isaxarr=matlab.graphics.chart.internal.objArrayDispatch(@zlabel,varargin{:});
|
< 0.001 | 2 | 20 | end
|
< 0.001 | 2 | 21 | if isaxarr
|
| | 22 | return
|
< 0.001 | 2 | 23 | end
|
| | 24 |
|
| | 25 | % if the input has a zlabel property which is a text object, use it to set
|
| | 26 | % the zlabel on.
|
< 0.001 | 2 | 27 | try
|
0.004 | 2 | 28 | [ax,args,nargs] = plotedit({'labelcheck','ZLabel',varargin});
|
| | 29 | catch ME
|
| | 30 | throw(ME);
|
< 0.001 | 2 | 31 | end
|
| | 32 |
|
< 0.001 | 2 | 33 | if nargs == 0 || (nargs > 1 && (rem(nargs-1,2) ~= 0))
|
| | 34 | error(message('MATLAB:zlabel:InvalidNumberOfInputs'))
|
< 0.001 | 2 | 35 | end
|
| | 36 |
|
< 0.001 | 2 | 37 | if isempty(ax)
|
< 0.001 | 2 | 38 | ax = gca;
|
| | 39 |
|
| | 40 | % Chart subclass support
|
| | 41 | % Invoke zlabel method with same number of outputs to defer output arg
|
| | 42 | % error handling to the method.
|
< 0.001 | 2 | 43 | if isa(ax,'matlab.graphics.chart.Chart')
|
| | 44 | if(nargout == 1)
|
| | 45 | hh = zlabel(ax,args{:});
|
| | 46 | else
|
| | 47 | zlabel(ax,args{:});
|
| | 48 | end
|
| | 49 | return
|
< 0.001 | 2 | 50 | end
|
< 0.001 | 2 | 51 | end
|
| | 52 |
|
< 0.001 | 2 | 53 | if isa(ax,'matlab.graphics.axis.GeographicAxes')
|
| | 54 | error(message('MATLAB:Chart:UnsupportedConvenienceFunction', 'zlabel', ax.Type));
|
< 0.001 | 2 | 55 | end
|
| | 56 |
|
< 0.001 | 2 | 57 | string = args{1};
|
< 0.001 | 2 | 58 | if isempty(string), string=''; end
|
< 0.001 | 2 | 59 | pvpairs = args(2:end);
|
| | 60 |
|
| | 61 | % get-set does not support strings as of now
|
< 0.001 | 2 | 62 | pvpairs = matlab.graphics.internal.convertStringToCharArgs(pvpairs);
|
| | 63 |
|
< 0.001 | 2 | 64 | if isappdata(ax,'MWBYPASS_zlabel')
|
| | 65 | fcn = getappdata(ax,'MWBYPASS_zlabel');
|
| | 66 | h = feval(fcn{:},string,pvpairs{:});
|
| | 67 |
|
| | 68 | %---Standard behavior
|
< 0.001 | 2 | 69 | else
|
0.010 | 2 | 70 | h = get(ax,'ZLabel');
|
< 0.001 | 2 | 71 | if ~isa(ax,'matlab.graphics.layout.Layout')
|
0.001 | 2 | 72 | set(h,'FontSizeMode','auto',...
|
| | 73 | 'FontUnitsMode','auto',...
|
| 2 | 74 | 'FontWeight',get(ax,'FontWeight'),...
|
| 2 | 75 | 'FontAngle',get(ax,'FontAngle'),...
|
| 2 | 76 | 'FontName',get(ax,'FontName'));
|
< 0.001 | 2 | 77 | end
|
< 0.001 | 2 | 78 | set(h, 'String', string, pvpairs{:});
|
| | 79 |
|
< 0.001 | 2 | 80 | end
|
| | 81 |
|
< 0.001 | 2 | 82 | if nargout > 0
|
| | 83 | hh = h;
|
< 0.001 | 2 | 84 | end
|
Other subfunctions in this file are not included in this listing.