# Why does Rotate in PlotMarkers behave strangely?

While answering Change the inner color of markers I came across a behavior that may be a bug.
I would like to know if there is another explanation.

First a basic example of normal behavior:

ListLinePlot[{Prime~Array~12, Fibonacci~Array~12},
PlotMarkers -> Graphics[{Brown, Rectangle[]}, ImageSize -> 13],
PlotLegends -> Automatic
]


Note that the markers are included in the legend. But now if I Rotate the Rectangle:

ListLinePlot[{Prime~Array~12, Fibonacci~Array~12},
PlotMarkers -> Graphics[{Brown, Rectangle[] ~Rotate~ (Pi/4)}, ImageSize -> 13],
PlotLegends -> Automatic
]


The markers disappear from the legend. They do appear if I Rotate the entire Graphics, however the markers are not scaled as before and they clip:

ListLinePlot[{Prime~Array~12, Fibonacci~Array~12},
PlotMarkers -> Graphics[{Brown, Rectangle[]}, ImageSize -> 13] ~Rotate~ (Pi/4),
PlotLegends -> Automatic
]


1. Is use of Rotate in plot markers simply unsupported or is this a bug?

2. Is there a way to use rotated primitives for markers and not break the legend?

-

A workaround is to use GeometricTransformation instead of Rotate. By specifying coordinates in the Offset form we can achieve consistent size of markers on the plot and in the legend. The cropping of the markers in the legend can be avoided by increasing their sizes as MinHsuan Peng suggests:

ListLinePlot[{Prime~Array~12, Fibonacci~Array~12},
PlotMarkers ->
Graphics[{Brown,
GeometricTransformation[
Rectangle[Offset[{-5, -5}], Offset[{5, 5}]],
RotationTransform[Pi/4]]}],
PlotLegends -> LineLegend[Automatic, LegendMarkerSize -> {40, 15}]]


As to whether it is a bug, I think it is because Rotated rectangles appear inside of the the code of the legend but are not shown. Even specifying them in the Offset form does not produce correct plot but reveals even more strange bugs:

ListLinePlot[{Prime~Array~12, Fibonacci~Array~12},
PlotMarkers ->
Graphics[{Brown,
Rectangle[Offset[{-5, -5}], Offset[{5, 5}]]~Rotate~(Pi/4)},
ImageSize -> 10], PlotLegends -> Automatic]


-

A workaround to question 2 is to increase legend marker size:

LineLegend[Automatic, LegendMarkerSize -> {40, 20}]

-