# HG changeset patch # User Konstantinos Poulios # Date 1288646408 -3600 # Node ID e0af58c31c66848ddb57097ebc64df3b42032b6d # Parent ef1719e8444e5fab0579d65cfb9922cb4c1a2c11 Making 'axis equal' equivalent to 'daspect([1,1,1])' diff -r ef1719e8444e -r e0af58c31c66 scripts/ChangeLog --- a/scripts/ChangeLog Mon Nov 01 22:12:45 2010 +0100 +++ b/scripts/ChangeLog Mon Nov 01 22:20:08 2010 +0100 @@ -1,3 +1,7 @@ +2010-11-01 Konstantinos Poulios + + * plot/axis.m: Make 'axis equal' equivalent to 'daspect([1,1,1])'. + 2010-11-01 Konstantinos Poulios * plot/private/__actual_axis_position__.m: Remove temporary diff -r ef1719e8444e -r e0af58c31c66 scripts/plot/axis.m --- a/scripts/plot/axis.m Mon Nov 01 22:12:45 2010 +0100 +++ b/scripts/plot/axis.m Mon Nov 01 22:20:08 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");