Skip to main content
6 of 7
correct mistake
Mr.Wizard
  • 275.2k
  • 34
  • 606
  • 1.5k

\[FilledSquare] is a font glyph and you cannot color parts of it.

I believe you need to draw your markers with Graphics primitives. For example:

square[in_, out_: Black, size_: 12] := Graphics[{in, EdgeForm[{AbsoluteThickness[2], out}], Rectangle[]}, PlotRangePadding -> 0, ImageSize -> size] data = {{1, 2, 3, 5, 8}, {2, 3, 6, 9, 10}, {4, 5, 7, 10, 12}}; ListLinePlot[data, PlotMarkers -> square /@ {Red, Green, Blue} ] 

enter image description here

ListLinePlot[data, PlotMarkers -> square @@@ {{Yellow, Red}, {White, Blue}, {Black, Pink}} ] 

enter image description here


Update: proof that this method can easily be used for markers of arbitrary shape.

Generic marker function:

marker[prim_, opts___][in_: White, out_: Black, size_: 13] := Graphics[{in, EdgeForm[{AbsoluteThickness[2], out}], prim}, opts, ImageSize -> size] 

Shapes:

square = marker @ Rectangle[]; circle = marker @ Disk[]; diamond = marker @ Polygon[{{0, 1}, {1, 2}, {2, 1}, {1, 0}}]; triangle = marker[ Polygon[{{1, 0}, {0, Sqrt[3]}, {-1, 0}}], AlignmentPoint -> {0, 1/Sqrt[3]} ]; 

Plot:

SeedRandom[12] ListLinePlot[ Accumulate /@ RandomReal[3, {4, 10}] {1, 2, 3, 4}, PlotMarkers -> {square[], circle[Yellow], diamond[Brown, Pink], triangle[Magenta, Purple]}, PlotLegends -> Automatic ] 

enter image description here

Mr.Wizard
  • 275.2k
  • 34
  • 606
  • 1.5k