1
$\begingroup$

I'm generating a ListPlot and wanting to use Open Markers like in the 2nd example here, however I don't want the word "Open Markers" - I just want open circles/diamonds etc. Are there default shapes you can still access with mathematica like this, or do you need to create all your own markers and define directly?

I know I can create all my own markers and make it anything I want, but I was hoping for some simple defaults that you can easily access. I've tried using Circle, Diamond, Square because those auto-completed, but I just get the words, not the symbols.

e.g.

ListPlot[{{1, 2, 3, 5, 8}, {2, 3, 6, 9, 10}, {4, 5, 7, 10, 12}}, 
 PlotMarkers -> "OpenMarkers"]

I am using v11.3.0

$\endgroup$
2
$\begingroup$

You can get markers using Charting`CommonDump`GraphicsOpenPlotMarkers:

{circle, uptriangle, diamond, square, downtriangle} = 
   Charting`CommonDump`GraphicsOpenPlotMarkers[][[;;5]];

ListPlot[{{1, 2, 3, 5, 8}, {2, 3, 6, 9, 10}, {4, 5, 7, 10, 12}}, 
 PlotMarkers -> {uptriangle, circle, square}]

enter image description here

$\endgroup$
  • $\begingroup$ This doesn't work in V12 with the warning Set::shape: Lists {circle,uptriangle,diamond,square,downtriangle} and ChartingCommonDumpGraphicsOpenPlotMarkers[] are not the same shape. $\endgroup$ – OkkesDulgerci Jul 12 at 1:08
  • $\begingroup$ @Okkes, it works on Wolfram Cloud (v12). You can try {circle,uptriangle,diamond,square,downtriangle} = ChartingCommonDumpGraphicsOpenPlotMarkers[][[;;5]] $\endgroup$ – kglr Jul 12 at 1:11
  • $\begingroup$ @OkkesDulgerci It works in V12 for me (Mac), but it does not work in V11.3, the version the OP has. BTW, PlotMarkers -> "OpenMarkers" does the same thing. $\endgroup$ – Michael E2 Jul 12 at 4:24
  • $\begingroup$ My bad. I guess the issue was backtick was missing when I pasted it. $\endgroup$ – OkkesDulgerci Jul 12 at 23:27
2
$\begingroup$

Here's a way to get to the open markers on V11.3, which start with the 6th plot marker in the standard V11.3 sequence of markers:

ListPlot[{{1, 2, 3, 5, 8}, {2, 3, 6, 9, 10}, {4, 5, 7, 10, 12}}, 
 PlotMarkers -> RotateLeft[Graphics`PlotMarkers[], 5]]

enter image description here

Note: V12 introduced PlotMarkers -> "OpenMarkers" (and Charting`CommonDump`GraphicsOpenPlotMarkers[], which @kglr's answer shows), which is a simpler way to get the desired result; however, it is unavailabe to the OP.

$\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.