Functions | |
if (isempty(varargout)) __axis__(h | |
endif unwind_protect_cleanup | axes (oldh) |
if (view(2)==90) curr_axis | |
endif endif | elseif (ischar(ax)) len |
if (strcmpi(ax,"ij")) set(ca | |
elseif (strcmpi(ax,"xy")) set(ca | |
elseif (strcmpi(ax,"image")) __axis__(ca | |
equal | __do_tight_option__ (ca) |
elseif (strcmpi(ax,"square")) if(__gnuplot_has_feature__("screen_coordinates_for_ | |
margin | set (ca,"dataaspectratio",[1, 1, 1]) |
endif | elseif (strcmp(ax,"equal")) if(__gnuplot_has_feature__("screen_coordinates_for_ |
endif | elseif (strcmpi(ax,"normal")) set(ca |
elseif (len >=4 &&strcmpi(ax(1:4),"auto")) if(len > 4) if(any(ax | |
endif | if (any(ax=="y")) set(ca |
endif | if (any(ax=="z")) set(ca |
endif else | set (ca,"xlimmode","auto","ylimmode","auto","zlimmode","auto") |
endif | elseif (strcmpi(ax,"manual")) set(ca |
elseif (strcmpi(ax,"tight")) __do_tight_option__(ca) | |
elseif (strcmpi(ax,"on")||strcmpi(ax,"tic")) set(ca | |
if (strcmpi(ax,"on")) set(ca | |
endif | set (ca,"visible","on") |
elseif (strcmpi(ax,"off")) set(ca | |
set (ca,"visible","off") | |
elseif (len > 3 &&strcmpi(ax(1:3),"tic")) if(any(ax | |
else | set (ca,"xtick",[]) |
else | set (ca,"ytick",[]) |
else | set (ca,"ztick",[]) |
endif | elseif (strcmpi(ax,"label")) set(ca |
elseif (strcmpi(ax,"nolabel")) set(ca | |
elseif (len > 5 &&strcmpi(ax(1:5),"label")) if(any(ax | |
else | set (ca,"xticklabel","") |
else | set (ca,"yticklabel","") |
else | set (ca,"zticklabel","") |
endif else | warning ("unknown axis option '%s'", ax) |
endif | elseif (isvector(ax)) len |
!plot (-3:3,-3:3,";line (-3,-3)->(3,3);") | |
!title ("manual") | |
!axis ("manual") | |
!subplot (324) | |
!plot (t, x,";sine [0:2pi];") | |
!title ("axes at [0 3 0 1], then autox") | |
!axis ([0, 3, 0, 1]) | |
axis ("autox") | |
!subplot (325) | |
!plot (t, x,";sine [0:2p];") | |
axis ("autoy") | |
!title ("axes at [3 6 0 1], then autoy") | |
!subplot (326) | |
!plot (t, sin(t), t,-2 *sin(t/2))%!axis("tight") | |
!title ("tight") | |
!plot (x, sin(x))%!axis image%!title("image")%!demo%!clf%![x | |
!pcolor (x-x1, y-x1/2, z)%!hold on%![x | |
Variables | |
function | varargout |
oldh = gca () | |
unwind_protect | axes (h) |
else [varargout{:}] = __axis__ (h, varargin{:}) | |
end_unwind_protect endfunction function | curr_axis |
else | xlim = get (ca, "xlim") |
ylim = get (ca, "ylim") | |
view = get (ca, "view") | |
else | zlim = get (ca, "zlim") |
ydir | |
reverse | |
normal | |
else | x = xlim |
y = ylim | |
endif | dataaspectratiomode |
endif | auto |
endif | ylimmode |
endif | zlimmode |
endif | xlimmode |
endif | manual |
xtickmode | |
ytickmode | |
ztickmode | |
xticklabelmode | |
yticklabelmode | |
zticklabelmode | |
xtick | |
ytick | |
ztick | |
xticklabel | |
yticklabel | |
zticklabel | |
if(len!=2 &&len!=4 &&len!=6) error("axis | sine [0:2pi] |
hold | on |
hold | off |
!demo!clf!axis image | !x = 0:0.1:10 |
z = peaks(50) | |
!x1 = max(x(:)) | |
!s = x1/max(x(:)) |
!axis | ( | ) |
!axis | ( | "manual" | ) |
!pcolor | ( | x- | x1, | |
y-x1/ | 2, | |||
z | ||||
) |
!plot | ( | x | , | |
sin(x) | ||||
) |
!plot | ( | t | , | |
sin(t) | , | |||
t | , | |||
-2 * | sint/2 | |||
) |
!plot | ( | t | , | |
x | , | |||
";sine ;" | [0:2p] | |||
) |
!plot | ( | t | , | |
x | , | |||
";sine ;" | [0:2pi] | |||
) |
!plot | ( | -3:3 | , | |
-3:3 | , | |||
";line (-3,-3)->(3,3);" | ||||
) |
!subplot | ( | 326 | ) |
!subplot | ( | 325 | ) |
!subplot | ( | 324 | ) |
!title | ( | "tight" | ) |
!title | ( | "axes | at[3 6 0 1], | |
then autoy" | ||||
) |
!title | ( | "axes | at[0 3 0 1], | |
then autox" | ||||
) |
!title | ( | "manual" | ) |
axis | ( | "autoy" | ) |
axis | ( | "autox" | ) |
endif elseif | ( | isvector(ax) | ) |
elseif | ( | len | , | |
5 && | strcmpiax(1:5),"label" | |||
) |
elseif | ( | strcmpi(ax,"nolabel") | ) |
endif elseif | ( | strcmpi(ax,"label") | ) |
elseif | ( | len | , | |
3 && | strcmpiax(1:3),"tic" | |||
) |
elseif | ( | strcmpi(ax,"off") | ) |
elseif | ( | strcmpi(ax,"on")||strcmpi(ax,"tic") | ) |
elseif | ( | strcmpi(ax,"tight") | ) |
endif elseif | ( | strcmpi(ax,"manual") | ) |
elseif | ( | len >=4 && | strcmpiax(1:4),"auto" | ) |
endif elseif | ( | strcmpi(ax,"normal") | ) |
endif elseif | ( | strcmp(ax,"equal") | ) |
elseif | ( | strcmpi(ax,"square") | ) |
elseif | ( | strcmpi(ax,"image") | ) |
elseif | ( | strcmpi(ax,"xy") | ) |
if | ( | strcmpi(ax,"on") | ) |
endif if | ( | any(ax=="z") | ) |
endif if | ( | any(ax=="y") | ) |
if | ( | strcmpi(ax,"ij") | ) |
if | ( | view(2) | = =90 |
) |
if | ( | isempty(varargout) | ) |
set | ( | ca | , | |
"visible" | , | |||
"off" | ||||
) |
margin set | ( | ca | , | |
"dataaspectratio" | ||||
) |
!s = x1/max(x(:)) |
!demo ! clf ! axis image !x = 0:0.1:10 |
!x1 = max(x(:)) |
endif auto |
else[varargout{:}] = __axis__ (h, varargin{:}) |
hold off |
oldh = gca () |
hold on |
varargout |
view = get (ca, "view") |
margin x = xlim |
y = ylim |
z = peaks(50) |