# HG changeset patch # User John W. Eaton # Date 1414696842 14400 # Node ID 8e18830609403cc6f7ce1a0d3beefc33b631a350 # Parent 95efaf0574a74adc6ee441b982f814a76466ae36 * zoom.m: Improve documentation. New demo. diff -r 95efaf0574a7 -r 8e1883060940 scripts/plot/util/zoom.m --- a/scripts/plot/util/zoom.m Wed Nov 05 08:05:31 2014 -0800 +++ b/scripts/plot/util/zoom.m Thu Oct 30 15:20:42 2014 -0400 @@ -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;