Mercurial > hg > octave-nkf
diff scripts/plot/appearance/axis.m @ 18537: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 | d63878346099 |
children | 00d684465379 |
line wrap: on
line diff
--- a/scripts/plot/appearance/axis.m +++ b/scripts/plot/appearance/axis.m @@ -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"))