ZOrder Get/Set
%ZOrderGet Get the current z-order position of an existing object of a figure
%
% [hIndex, hCount] = ZOrderGet(h = gco)
%
% Set a new z-order position of an existing object of a figure.
% The lower the z-order, the closer the object to the user eye.
%
% When adding a new object to a figure, by default it is provided with
% the first z-order value, so it becomes the most visible one.
%
% Example:
% figure(1); clf; hold on;
% h1 = plot(1, 1, 'o', 'MarkerSize', 10, 'MarkerFaceColor', [1 0 0]);
% h2 = plot(1, 1, 'o', 'MarkerSize', 20, 'MarkerFaceColor', [0 1 0]);
% % the red marker (h1) is not visible at this time
% [i cnt] = ZOrderGet(h1)
% i =
% 2
% cnt =
% 2
%
% Thanks and inspired to AddReorderButtons by Geoffrey K. Adams, November 2007
%
% Copyright 2011
%
% v1.0.0 - 28/04/2011
% Marcello Ferro <marcello.ferro@ilc.cnr.it>
% http://www.ilc.cnr.it
%
%ZOrderSet Set a new z-order position of an existing object of a figure
%
% ZOrderSet(h = gco, zIndex = 0 (last, default) | n (n-th) | -n (n-th last))
%
% Set a new z-order position of an existing object of a figure.
% The lower the z-order, the closer the object to the user eye.
%
% The zIndex is the target z-order of the object. If out of boundaries,
% it will be clipped.
%
% When adding a new object to a figure, by default it is provided with
% the first z-order value, so it becomes the most visible one.
%
% Example:
% figure(1); clf; hold on;
% h1 = plot(1, 1, 'o', 'MarkerSize', 10, 'MarkerFaceColor', [1 0 0]);
% h2 = plot(1, 1, 'o', 'MarkerSize', 20, 'MarkerFaceColor', [0 1 0]);
% % the red marker (h1) is not visible at this time
% ZOrderSet(h1, 1); % set it to first position: the red marker is visible
% ZOrderSet(h1, 2); % set it to 2nd (last) position: the red marker is not visible
% ZOrderSet(h1, 0); % set it to last position: the red marker is not visible
%
% Thanks and inspired to AddReorderButtons by Geoffrey K. Adams, November 2007
%
% Copyright 2011
%
% v1.0.0 - 28/04/2011
% Marcello Ferro <marcello.ferro@ilc.cnr.it>
% http://www.ilc.cnr.it
%
Citar como
Marcello Ferro (2026). ZOrder Get/Set (https://la.mathworks.com/matlabcentral/fileexchange/31229-zorder-get-set), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Compatibilidad con las plataformas
Windows macOS LinuxCategorías
- MATLAB > Graphics > Images > Display Image >
Etiquetas
Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
| Versión | Publicado | Notas de la versión | |
|---|---|---|---|
| 1.0.0.0 |
