5
$\begingroup$

I want to use differently shaped and sized open plot markers to visualize overlapping data more clearly in ListPlot.

To this end I extracted plot markers according to the method proposed in PlotMarkers - are there default common shapes available?. I rescale them appropriately using:

Offset[{a_, b_}] :> Offset[scale {a, b}]

(Probably not the smartest way but it works here.)

However, there is a clear problem when using these. Intersecting lines of different markers do not show up. The open shape seems to be filled in with a background. Although that is not exactly what is happening because if I put a background behind the plot this is shown through the open plot markers.

How do I get differently shaped re-sizable open plot markers that are see-through in their interior?

Below is an image showing the "wrong" overlapping behavior that I want to avoid. I would like the shape of one plotmarker to continue under the other.

Wrong overlapping behaviour

$\endgroup$

1 Answer 1

11
$\begingroup$

You can insert FaceForm[] before Disk and Polygon primitives:

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

scale = 4;
markers = {uptriangle, circle, square} /. {p : _Disk | _Polygon :> {FaceForm[], p}, 
     Offset[{a_, b_}] :> Offset[scale {a, b}]};

scale = 4;
ListPlot[{{1, 3, 6}, {2, 3, 6}, {1, 5, 6}}, 
 PlotRangePadding -> Scaled[.1], PlotMarkers -> markers]

enter image description here

Alternatively, using PlotMarkers -> "OpenMarkers" and post-processing:

ListPlot[{{1, 3,6}, {2, 3, 6}, {1,5,6}}, PlotRangePadding->Scaled[.1],
 PlotMarkers ->{ "OpenMarkers", 25}] /.
      { p:_Disk|_Polygon:> {FaceForm[], p}, 
      AbsoluteThickness[_]:> AbsoluteThickness[2]}

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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