Functions | |
function | datetick (varargin)[h |
if (nargin< 1) print_usage() | |
__datetick__ (varargin{:}) | |
unwind_protect_cleanup | axes (oldh) |
!plot (datenum(yr, 1, 1), pop) | |
!title ("US population (millions)") | |
!xlabel ("Year") | |
!datetick ("x","YYYY") | |
function | __datetick__ (varargin) keeplimits |
if (ischar(arg)) if(strcmpi(arg | |
elseif (strcmpi(arg,"keeptick")) keeptick | |
endif endif endfor | varargin (idx) |
if (nargin!=0) arg | |
if (ischar(arg)&&(strcmp(arg,"x")||strcmp(arg,"y")||strcmp(arg,"z"))) ax | |
if (nargin > 1) form | |
varargin (1:2) | |
else | varargin (1) |
endif endif | if (length(varargin) > 0) startdate |
endif | if (isnumeric(form)) if(!isscalar(form)||floor(form)! |
Variables | |
function | varargin |
function | nargin = __plt_get_axis_arg__ ("datetick", varargin{:}) |
else | oldh = gca () |
unwind_protect | axes (h) |
end_unwind_protect endif endfunction!demo | !yr = 1900:10:2000 |
!pop | |
keeptick = false | |
idx = [] | |
for | i |
keeplimits | keeplimits = true |
form = [] | |
ax = "x" | |
else | startdate = [] |
!datetick | ( | "x" | , | |
"YYYY" | ||||
) |
!plot | ( | datenum(yr, 1, 1) | , | |
pop | ||||
) |
!title | ( | "US population (millions)" | ) |
!xlabel | ( | "Year" | ) |
function __datetick__ | ( | varargin | ) |
__datetick__ | ( | ) |
function datetick | ( | varargin | ) |
elseif | ( | strcmpi(arg,"keeptick") | ) |
if | ( | nargin | , | |
1 | ||||
) |
if | ( | ischar(arg)&&(strcmp(arg,"x")||strcmp(arg,"y")||strcmp(arg,"z")) | ) |
if | ( | nargin! | = 0 |
) |
if | ( | ischar(arg) | ) |
if | ( | ) |
else varargin | ( | 1 | ) |
varargin | ( | 1:2 | ) |
!pop |
Initial value:
[76.094, 92.407, 106.461, 123.077 131.954, 151.868, 179.979, ... %! 203.984, 227.225, 249.623, 282.224]
end_unwind_protect endif endfunction !demo !yr = 1900:10:2000 |
ax = "x" |
idx = [] |
keeplimits keeplimits = true |
keeptick = false |
nargin = __plt_get_axis_arg__ ("datetick", varargin{:}) |
function varargin |