Mercurial > hg > octave-nkf
diff scripts/plot/util/zoom.m @ 19502:8e1883060940
* zoom.m: Improve documentation. New demo.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 30 Oct 2014 15:20:42 -0400 |
parents | ec037d41da06 |
children | dfea01b3425f |
line wrap: on
line diff
--- a/scripts/plot/util/zoom.m +++ b/scripts/plot/util/zoom.m @@ -30,8 +30,8 @@ ## ## Given the option @qcode{"out"}, zoom to the initial zoom setting. ## -## Given the option @qcode{"reset"}, set the initial zoom setting to the -## current axes limits. +## Given the option @qcode{"reset"}, store the current zoom setting so +## that @code{zoom out} will return to this zoom level. ## ## @seealso{pan, rotate3d} ## @end deftypefn @@ -141,3 +141,24 @@ endif endfunction + +%!demo +%! clf; +%! sombrero (); +%! pause (1); +%! %% zoom in by a factor of 2 +%! zoom (2); +%! pause (1); +%! %% return to original zoom level +%! zoom out; +%! pause (1); +%! %% zoom in by a factor of 2 +%! zoom (2); +%! pause (1); +%! %% set this zoom level as the "initial zoom level" +%! %% and zoom in some more +%! zoom reset; +%! zoom (2); +%! pause (1); +%! %% return to zoom level set by last call to "zoom reset" +%! zoom out;