I am experiencing a problem that a left margin is added to my Graphics
if I include an arrow that is rotated by 3Pi/4
and shifted by -1
. And only for those values. Here is a demo of my problem:
Grid[Table[
Graphics[{Thick, Arrowheads[0.05], {
Translate[Rotate[Arrow[{{-1/2, 0}, {1/2, 0}}], phi], shift],
Line[{{-1.7, 0}, {1.7, 0}}],
Line[{{-1, -1.7}, {-1, 1.7}}]
}}, AspectRatio -> 1, ImageMargins -> 0],
{phi, 0, 3 Pi/4, Pi/4},
{shift, {{1, 0}, {0, 1}, {-1, 0}}}
],
Frame -> All]
The lines are just to ensure that the bounding box of the resulting graphics remains unchanged. Here is the output:
All graphics are centered and have a symmetric margin, apart from the bottom-left one. Probably related is that arrows by themselves apparently do not rotate around the center of their bounding box:
Grid[{Table[Graphics[{Thick, Arrowheads[0.1], {
Rotate[Arrow[{{-1/2, 0}, {1/2, 0}}], phi]
}}, AspectRatio -> 1],
{phi, 0, 3 Pi/4, Pi/4}]
},
Frame -> All]
Note that the arrows in the first image did rotate correctly around their bounding box. For instance, in the bottom-right cell, the center of the rotated and shifted arrow is exactly at the intersection of the two lines, i.e., at (-1,0)
as expected from the translation. Still, all these problems disappear if I explicitly specify the rotation center via
Rotate[Arrow[{{-1/2, 0}, {1/2, 0}}], phi, {0, 0}]
Is this a bug?
{3, 2}
. $\endgroup$