4

How can I obtain crosses as plot markers in a ListPlot?

I know how to obtain circles, disks, squares, using Graphics, like PlotMarkers -> {Graphics[{Red, Thick, Disk[]}, ImageSize -> 10]}. But I can't think of any way to obtain a cross this way, other than actually drawing the cross, which seems overkill. Is there a simpler way? I just need some advice on the best way to do this without too much work.

a06e
  • 11,327
  • 4
  • 48
  • 108

2 Answers2

10

Using PlotMarkers -> "+" is not a good solution, because the text is aligned with its foot at the point, not the centre of the cross.

If you want the centre of the cross to have a precise position in the plot, you can use:

cross = Graphics[{Line[{{-1,0},{1,0}}], Line[{{0,-1},{0,1}}]}] 
ListPlot[data, PlotMarkers -> {cross,0.05}]
Jan Stopka
  • 116
  • 1
  • 2
  • Hi Jan, Welcome to Mma.SE. thanks for making your first contribution to Mma.SE. Be sure to take the [tour]. The site depends on participation, and I'm glad to see your first activity was to share what you have learned and give an answer. Your answer was flagged, as a new user, so I was checking everything was fine, and as it is, I can only welcome and thank you. (+1). – rhermans Aug 31 '18 at 08:28
2

This would be a simple solution:

ListPlot[{1, 2, 3, 4}, PlotMarkers -> Style["+", {Black, FontSize -> 20}]]

enter image description here

Ruud3.1415
  • 842
  • 4
  • 20