Group Abstract Group Abstract

Message Boards Message Boards

Use ColorData on a list to get a list of colors covering all SiennaTones?

Attachments:
POSTED BY: Ruth Lazkoz

When you give PlotStyle a list, it wants to look at the first argument and find a list of the same length. But in this case, since you are calling ListPlot - you need the first argument to be a list of lists with the same length as the list of styles. So you could do this:

ListPlot[Thread[{ray}], 
 PlotStyle -> ({PointSize[0.01], 
      ColorData[{"SiennaTones", "Reverse"}][#]} & /@ ray[[All, 2]])]

But if you look at the doc page for ListPlot, there is a documented way to color each point individually using Style. So this also works:

ListPlot[Style[#, ColorData[{"SiennaTones", "Reverse"}][#[[2]]]] & /@ 
  ray, PlotStyle -> PointSize[0.01]]
POSTED BY: Jason Biggs
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard