# HG changeset patch # User Pantxo Diribarne # Date 1591216986 -7200 # Node ID 8ffe43de8bfebeee17680528a9d4469d535736d2 # Parent 2a0e566a03e1b8708a8285ce247e9444a148bb56 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. diff -r 2a0e566a03e1 -r 8ffe43de8bfe scripts/plot/appearance/legend.m --- 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)