changeset 18469:343718b2eee4 stable

axis.m: restore plotbox and data aspect ratios with 'axis normal' (bug #41581). Use manual plotboxaspectratio for 'axis equal' for Matlab compatibility. * axis.m: Use a manual plotboxaspectration of [5 4 4] for 'axis equal' for Matlab compatibility. For 'axis normal', first set an arbitrary plotboxaspectratio and then set plotboxaspectratio and dataaspectratio to "auto" such that a re-calculation is forced.
author Rik <rik@octave.org>
date Sat, 15 Feb 2014 20:16:27 -0800
parents 9cfba3616503
children 044bbf569cd3 83cc56cc7cb7
files scripts/plot/appearance/axis.m
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/appearance/axis.m	Thu Feb 13 16:34:06 2014 -0500
+++ b/scripts/plot/appearance/axis.m	Sat Feb 15 20:16:27 2014 -0800
@@ -197,10 +197,14 @@
         ## (useful with the x11 gnuplot terminal after a window resize)
         set (ca, "dataaspectratiomode", "auto");
       endif
-      set (ca, "dataaspectratio", [1, 1, 1]);
+      set (ca, "dataaspectratio", [1, 1, 1], "plotboxaspectratio", [5 4 4]);
+      
     elseif (strcmpi (ax, "normal"))
-      set (ca, "plotboxaspectratio", [1, 1, 1]);
-      set (ca, "plotboxaspectratiomode", "auto");
+      ## Set plotboxaspectratio to something obtuse so that switching
+      ## back to "auto" will force a re-calculation.
+      set (ca, "plotboxaspectratio", [3 2 1]);
+      set (ca, "plotboxaspectratiomode", "auto",
+               "dataaspectratiomode", "auto");
 
       ## axis limits
     elseif (len >= 4 && strcmpi (ax(1:4), "auto"))