changeset 17742:4e225f952885

Fix shrinking axes when printing plots with legends (bug #40333). * scripts/plot/util/print.m: Restore properties in the order they were saved so that "units" property gets set before "position" and figure position is restored before axes object is restored.
author Rik <rik@octave.org>
date Wed, 23 Oct 2013 16:55:26 -0700
parents f6293489fe88
children af5ad573c665
files scripts/plot/util/print.m
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/util/print.m	Wed Oct 23 18:27:06 2013 -0400
+++ b/scripts/plot/util/print.m	Wed Oct 23 16:55:26 2013 -0700
@@ -314,7 +314,7 @@
     props(1).value = {get(opts.figure, "units")};
     set (opts.figure, "units", "pixels");
 
-    ## graphics toolkit tranlates figure position to eps bbox in points
+    ## graphics toolkit translates figure position to eps bbox (points)
     fpos = get (opts.figure, "position");
     props(2).h = opts.figure;
     props(2).name = "position";
@@ -322,9 +322,9 @@
     fpos(3:4) = opts.canvas_size;
     set (opts.figure, "position", fpos);
 
-    ## Set figure background to none. This is done both for
-    ## consistency with Matlab and to elliminate the visible
-    ## box along the figure's perimeter.
+    ## Set figure background to none.
+    ## This is done both for consistency with Matlab and to eliminate
+    ## the visible box along the figure's perimeter.
     props(3).h = opts.figure;
     props(3).name = "color";
     props(3).value{1} = get (props(3).h, props(3).name);
@@ -425,7 +425,7 @@
   unwind_protect_cleanup
     ## restore modified properties
     if (isstruct (props))
-      for n = numel (props):-1:1
+      for n = 1:numel (props)
         if (ishandle (props(n).h))
           set (props(n).h, props(n).name, props(n).value{1});
         endif