time | calls | line |
---|
| | 1 | function a = xlim(arg1, arg2)
|
| | 2 | %XLIM X limits.
|
| | 3 | % XL = XLIM gets the x limits of the current axes.
|
| | 4 | % XLIM([XMIN XMAX]) sets the x limits.
|
| | 5 | % XLMODE = XLIM('mode') gets the x limits mode.
|
| | 6 | % XLIM(mode) sets the x limits mode.
|
| | 7 | % (mode can be 'auto' or 'manual')
|
| | 8 | % XLIM(AX,...) uses axes AX instead of current axes.
|
| | 9 | %
|
| | 10 | % XLIM sets or gets the XLim or XLimMode property of an axes.
|
| | 11 | %
|
| | 12 | % See also PBASPECT, DASPECT, YLIM, ZLIM.
|
| | 13 |
|
| | 14 | % Copyright 1984-2005 The MathWorks, Inc.
|
| | 15 |
|
| 44 | 16 | if nargin == 0
|
| | 17 | a = get(gca,'xlim');
|
| 44 | 18 | else
|
| 44 | 19 | if isscalar(arg1) && ishghandle(arg1) && isprop(arg1,'XLim')
|
| | 20 | ax = arg1;
|
| | 21 | if nargin==2
|
| | 22 | val = arg2;
|
| | 23 | else
|
| | 24 | a = get(ax,'xlim');
|
| | 25 | return
|
| | 26 | end
|
| 44 | 27 | else
|
| 44 | 28 | if nargin==2
|
| | 29 | error(message('MATLAB:xlim:InvalidNumberArguments'))
|
| 44 | 30 | else
|
| 44 | 31 | ax = gca;
|
| 44 | 32 | val = arg1;
|
| 44 | 33 | end
|
| 44 | 34 | end
|
| | 35 |
|
| 44 | 36 | if ischar(val)
|
| | 37 | if(strcmp(val,'mode'))
|
| | 38 | a = get(ax,'xlimmode');
|
| | 39 | else
|
| | 40 | set(ax,'xlimmode',val);
|
| | 41 | end
|
| 44 | 42 | else
|
| 44 | 43 | set(ax,'xlim',val);
|
| 44 | 44 | end
|
| 44 | 45 | end
|