3
$\begingroup$

I make my own symbols for plotting:

onesymb =  Graphics[{EdgeForm[Directive[AbsoluteThickness[2], Black]], Red,    Rectangle[]}, ImageSize -> 18]

twosymb =  Graphics[{EdgeForm[Directive[AbsoluteThickness[2], Black]], White, Polygon[Dynamic@     Flatten[Table[{{Cos[i*2 \[Pi]/ns], Sin[i*2 \[Pi]/ns]}, 
    0.4 {Cos[(i + 0.5)*2 \[Pi]/ns],  Sin[(i + 0.5)*2 \[Pi]/ns]}}, {i, ns + 1}], 1]]},  ImageSize -> 26]

but when I use them:

ListPlot[{{{0.5, 0.5}, {2, 2}}, {{1, 1}, {1, 4}}}, PlotMarkers -> {onesymb,twosymb}, PlotRange -> {{0, 3}, {0, 3}}, PlotLegends - Placed[LineLegend[{{"one", "two"}},    LabelStyle -> {Black, FontFamily -> "Helvetica", FontSize -> 20},    LegendMarkerSize -> 20], Right]]

I notice that, in the legend, the symbols loose their (black) edge. How to repair this in Mathematica 12? thanks

enter image description here

$\endgroup$
3
$\begingroup$

Use EdgeForm[Directive[AbsoluteThickness[2], Black, Opacity[1]]] when you define you markers.

enter image description here

You can also use EdgeForm[Directive[AbsoluteThickness[2], Opacity[1, Black]]].

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.