Mercurial > octave
changeset 28400:8ffe43de8bfe stable
legend.m: fix position for non default dataaspectratio (bug #58492)
* legend.m (boxposition): Don't test "plotboxaspectratiomode" is "auto",
it is not an indication that position and plotbox match.
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Wed, 03 Jun 2020 22:43:06 +0200 |
parents | 2a0e566a03e1 |
children | 80f873d55bff 26d69b0a3e8d |
files | scripts/plot/appearance/legend.m |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/appearance/legend.m Tue Jun 02 21:53:54 2020 +0200 +++ b/scripts/plot/appearance/legend.m Wed Jun 03 22:43:06 2020 +0200 @@ -1280,11 +1280,11 @@ endswitch endfunction -function pos = boxposition (axpos, pbam, pba) +function pos = boxposition (axpos, pba) pos = axpos; pbratio = pba(1)/pba(2); posratio = axpos(3)/axpos(4); - if (strcmp (pbam, "manual") && pbratio != posratio) + if (pbratio != posratio) if (posratio < pbratio) pos(4) = pos(3) / pbratio; pos(2) += (axpos(4) - pos(4)) / 2; @@ -1348,7 +1348,7 @@ [li, axpos, pbam, pba] = get (hax, {"looseinset", "position", ... "plotboxaspectratiomode", ... "plotboxaspectratio"}){:}; - axpos = boxposition (axpos, pbam, pba); + axpos = boxposition (axpos, pba); lpos = [get(hl, "position")(1:2), sz]; if (! outside)