9

The code below gives color-varying points with explicit Style wrappers:

ListPlot[Table[Style[{Cos[t], Sin[2 t]}, Hue[t/(2 Pi)]], {t, 0, 2 Pi,Pi/20}],PlotStyle -> PointSize[Medium]]

enter image description here

However, when I want to change the marker shape with PlotMarkers, the color settings are shadowed with default color:

ListPlot[Table[  Style[{Cos[t], Sin[2 t]}, Hue[t/(2 Pi)]], {t, 0, 2 Pi, Pi/20}], PlotStyle -> PointSize[Medium], PlotMarkers -> Automatic]

enter image description here

My questions are:

  1. Can such behavior be considered as a bug?

  2. What is the workaround for changing to another marker?

sunt05
  • 4,367
  • 23
  • 34

1 Answers1

9

Edit My previous answer was just a workaround, and it involved putting the color as a graphics directive for the individual plotmarkers.

My thanks to @rcollyer for bringing an undocumented option to my attention which is the true solution to this problem. You just need to set Method -> {"OptimizePlotMarkers" -> False}

ListPlot[Table[
  Style[{Cos[t], Sin[2 t]}, Hue[t/(2 Pi)]], {t, 0, 2 Pi, Pi/20}], 
 PlotStyle -> PointSize[Medium], PlotMarkers -> Automatic, 
 Method -> {"OptimizePlotMarkers" -> False}]

enter image description here

Jason B.
  • 68,381
  • 3
  • 139
  • 286