28

Mathematica has ten basic plot markers which are used cyclically when making a ListPlot with PlotMarkers->Automatic. There are filled and empty versions of circle, square, diamond, up triangle, and down triangle. The eleventh marker repeats filled circle, but in a different color. For example,

ListPlot[Table[{i, i + #}, {i, 1, 7}] & /@ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, PlotMarkers -> Automatic]

gives

PlotMarkers defaults

Is it possible to specify a particular plot marker from this set of default markers? The FullForm of the above plot shows that Mathematic uses fonts for those symbols, i.e.

Style["\[FilledCircle]", Rule[FontSize, 8.96]]`

which one could set by hand, but I'm wondering if there is a way to do this in the way that one can pick from the default plot colors using ColorData[1][n], where n is the nth color.

JxB
  • 977
  • 1
  • 7
  • 12

3 Answers3

30
Graphics`PlotMarkers[] 

has the information you want, although it's very undocumented and subject to change.

Brett Champion
  • 8,497
  • 1
  • 27
  • 44
  • Still a bit awkward for specifying the size ({`Graphics``PlotMarkers[][[3,1]],7}`), but it works, thanks. – JxB May 18 '11 at 02:10
  • 5
    The output is a list of `{marker, size}` pairs, so you could just use `{Graphics\`PlotMarkers[][[3]]}`, if the default size is acceptable... – Brett Champion May 18 '11 at 03:06
  • Thanks for the useful answer, but you don't get an up vote because you guys didn't document PlotMarkers sufficiently. – mdeceglie Sep 22 '15 at 20:05
5

If you are using the GUI interface, also note that you can select these characters from the Typesetting Palette, and some even have keyboard shortcuts, e.g. ESC fci ESC or ESC fsq ESC for filled circles and squares, respectively. (Tested in Mathematica 9)

Patrick Sanan
  • 2,375
  • 1
  • 23
  • 25
0

The inbuilt symbol in Mathematica can be used to define a set of symbols and use them in the order one likes.

{filledcircle, filledsquare, filleddiamond, filleduptriangle, filleddowntriangle, circle, square, diamond, uptriangle, downtriangle} = Graphics`PlotMarkers[][[All, 1]]