changeset 19344:8e1883060940

* zoom.m: Improve documentation. New demo.
author John W. Eaton <jwe@octave.org>
date Thu, 30 Oct 2014 15:20:42 -0400
parents 95efaf0574a7
children 912158cf524d
files scripts/plot/util/zoom.m
diffstat 1 files changed, 23 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;