How to color each point with a different color in ListPlot?? Please help

Hello colleagues… I’m afraid that this is an easy question, but I found no solution yet

Here it goes: I have a list of points, and a list of colors (both of the same length), say:

 aList = {{1, 1}, {2, 3}, {4, 5}, {6, 7}};
 colorList = {Black, Red, Blue, Yellow};

I want to plot the points using ListPlot, but taking care that each point should have a different color, according to the colorList.
So, the point {1,1} should be colored black, the point {2,3} should be red, and so on…
In the actual problem I’m solving, the length of the list is about 30.000, so I need an efficient way to construct the plots…

Thank you very much!!! :slight_smile:

Daniel

You can make the list of points a list of lists, each having a single point. ListPlot treats it as multiple plots, with each directive in a PlotStyle applying to a one-point list. The PlotStyle directives would be used cyclically for larger lists.

aList = {{1, 1}, {2, 3}, {4, 5}, {6, 7}};

colorList = {Black, Red, Blue, Yellow};

bList = {#} & /@ aList;

ListPlot[bList, PlotStyle -> colorList]

Or you can just construct your own list of points. With a color directive coming before each point in the list. You can use usual options to get the range, axes, labels as you want.

Graphics[Prepend[Riffle[colorList, Point /@ aList], PointSize[.02]], 
 Frame -> True]

Thank you so much David!!! Pretty neat, thank you :slight_smile: