# HG changeset patch # User Rik # Date 1392524187 28800 # Node ID 343718b2eee4fd99cf97dd07be761fd8bbdfeeb0 # Parent 9cfba3616503360e1c7a6a6f8ae08610add49afa 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. diff -r 9cfba3616503 -r 343718b2eee4 scripts/plot/appearance/axis.m --- 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"))