I am trying to use PolygonMarkers as markers for a ListPlot and its legend. However, for some reason, the legend markers get cut off and are not shown fully. Here is an example:
(* creating the marker *)
tps = Show[
ResourceFunction["PolygonMarker"][
"ThreePointedStar", {Offset[10], 3}, {EdgeForm[Black],
FaceForm[White]}],
ResourceFunction["PolygonMarker"][
"ThreePointedStar", {Offset[5], 3}, {EdgeForm[White],
FaceForm[Red]}]
]
(* a simple ListPlot example *)
ListPlot[
Table[{i, 2 i}, {i, 1, 5}],
Joined -> False, FrameLabel -> {"a", "b"},
PlotLabel -> "F",
PlotLegends ->
Placed[LineLegend[{"T"}], {Top, Right}],
PlotMarkers -> Style[tps, Magnification -> 2],
PlotRange -> Automatic,
ImagePadding -> All,
ImageSize -> Medium]
In this case, the legend marker is cut off. The only solution that I found is to set
LegendMarkerSize
to around 40. However, this does not seem like an ideal workaround; I would expect the Legend command automatically take care of the size of the markers, so that it would work for different markers with different sizes that I want to use.
Is there a way to make this automatic adjustment?