# using colordata on a list

want to plot some rays with "warm" colors, so I started with a radial ray with a few points.

ray = Flatten[ Table[{r Cos[Theta], r Sin[Theta]}, {r, 0, 1, 0.1}, {Theta, 0.7, 0.7}], 1];


After reading mathematica help I believe the result of this command

ColorData[{"SiennaTones", "Reverse"}][#/(Max[ray[[All, 2]]])] & /@ ray[[All, 2]]


is going to inform me of the colors that the 11 points in the initial list will have when using that command as an option to ListPlot. That command produces an array of colors covering the whole range of SiennaTones, which range from whiteish to brown. So I do it like this:

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


And all I get are whiteish points. Can anybody kindly help me?

Thanks,

Ruth

You are close:

ray = Flatten[ Table[{r Cos[Theta], r Sin[Theta]}, {r, 0, 1, 0.1}, {Theta, 0.7, 0.7}], 1];
style = ColorData[{"SiennaTones", "Reverse"}][#/(Max[ray[[All, 2]]])] & /@ ray[[All, 2]];

ListPlot[ Style[ #1, #2]& @@@ Transpose@{ray,style} ]


Or shorter:

ListPlot[ List /@ ray, PlotStyle -> style ]


The problem with what you have tried is, that a list of points is treated as one set which only has one color. Thus you have to make each point a list of its own.

• Thanks a lot, very informative answer. I used to learn a lot with this forum. Love to be back into business. Commented Oct 26, 2018 at 12:54
• @Ruth Great to hear that I could help. Do not forget to (eventually) accept an answer. ;-)
– gwr
Commented Oct 26, 2018 at 13:37