# HG changeset patch # User Konstantinos Poulios # Date 1288779107 -3600 # Node ID 5b48695f3c13a1cfd9396a4e1cbf585f7942512d # Parent d9a8a008c116cc1699e156cbd6b8b701c4611dfa Making 'axis equal' equivalent to 'daspect([1,1,1])' diff -r d9a8a008c116 -r 5b48695f3c13 scripts/ChangeLog --- a/scripts/ChangeLog Wed Nov 03 11:09:02 2010 +0100 +++ b/scripts/ChangeLog Wed Nov 03 11:11:47 2010 +0100 @@ -1,3 +1,7 @@ +2010-11-03 Konstantinos Poulios + + * plot/axis.m: Making 'axis equal' equivalent to 'daspect([1,1,1])'. + 2010-11-03 Konstantinos Poulios * plot/private/__actual_axis_position__.m: Remove temporary diff -r d9a8a008c116 -r 5b48695f3c13 scripts/plot/axis.m --- a/scripts/plot/axis.m Wed Nov 03 11:09:02 2010 +0100 +++ b/scripts/plot/axis.m Wed Nov 03 11:11:47 2010 +0100 @@ -182,13 +182,15 @@ elseif (strcmpi (ax, "square")) set (ca, "plotboxaspectratio", [1, 1, 1]); elseif (strcmp (ax, "equal")) - x = xlim; - y = ylim; if (strcmp (get (get (ca, "parent"), "__backend__"), "gnuplot")) ## FIXME - gnuplot applies the aspect ratio activepostionproperty. set (ca, "activepositionproperty", "position"); + ## The following line is a trick used to trigger the recalculation of + ## aspect related magnitudes even if the aspect ratio is the same + ## (useful with the x11 gnuplot terminal after a window resize) + set (ca, "dataaspectratiomode", "auto"); endif - set (ca, "plotboxaspectratio", [(x(2)-x(1)), (y(2)-y(1)), 1]); + set (ca, "dataaspectratio", [1, 1, 1]) elseif (strcmpi (ax, "normal")) set (ca, "plotboxaspectratio", [1, 1, 1]) set (ca, "plotboxaspectratiomode", "auto");