2
$\begingroup$

Consider the following example:

p = Plot[x^2, {x,0,1}]
r1 = Legended[GraphicsRow[{p,p}], Placed["x", {{0,0.5}, {0,0.5}}]]
r2 = Legended[GraphicsRow[{p,p}], Placed["x", {{1,0.5}, {1,0.5}}]]

As I understand it, this should place the legend against the left and right edges of the graphic respectively, and that is indeed what happens when using a single plot. But when applying the legend to a row, I get the following:

Show[r1]

enter image description here

Show[r2]

enter image description here

As you can see, the legend is (correctly) vertically centered, but the horizontal placement is messed up: the scaled positions 0 and 1 are not the edges of the row, but something in between. (The plots are also being clipped for some reason.) Why does this happen?

$\endgroup$
3
  • $\begingroup$ What version and OS are you using? With 12.2.0 for Mac OS X x86 (64-bit) (December 12, 2020) the legends are on the left and right edges. $\endgroup$
    – Bob Hanlon
    Mar 18 '21 at 14:01
  • $\begingroup$ @BobHanlon I'm on 12.0.0.0 for Windows 64-bit. That's interesting... $\endgroup$
    – Javier
    Mar 18 '21 at 14:02
  • 1
    $\begingroup$ I can reproduce your results on 12.0.0 for Mac OS X x86 (64-bit) (April 7, 2019) but works properly on 12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020) $\endgroup$
    – Bob Hanlon
    Mar 18 '21 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.