Simple ListPlot with different colors and labels [duplicate]

I want to plot a list of points where every point has a different colour. Is it also possible to label these points according to a list of sample names I have in Excel? Please help.

• Giving a different color to each point is not that hard, you can use Style, look at the help page for ListPlot and you find the example ListPlot[Table[ Style[{Cos[t], Sin[2 t]}, Hue[t/(2 Pi)]], {t, 0, 2 Pi, Pi/20}], PlotStyle -> PointSize[Medium]] Commented Mar 11, 2016 at 12:20
• Thanks for your answer. I do find it difficult to apply it to my case though. I simply have an imported list of points from Excel that I would like to plot in Mathematica. Commented Mar 11, 2016 at 13:56

ListPlot accepts a list of list of points, assigning new colours to each of the sublists.

points = Table[{{RandomReal[{1, 10}], RandomReal[{1, 10}]}}, {i, 1, 10}]

(* {{{1.54315, 3.96704}}, {{6.2341, 6.44874}}, {{1.88163,
5.46795}}, {{2.37001, 7.649}}, {{6.74071, 3.67992}}, {{9.87758,
4.82062}}, {{9.71256, 2.90955}}, {{2.53583, 6.80984}}, {{9.04613,
1.49516}}, {{8.10797, 4.08785}}} *)

labels = Table["Dot " <> ToString[i], {i, 1, 10}]

ListPlot[points, PlotLegends -> labels]


gives

• Thanks for your answer! I formulated my imported dataset into the Table format you have here and then the rest worked perfectly for me. Commented Mar 11, 2016 at 13:58
• Any idea if I could have the labels next to each data point? By using PlotMarkers and Table command perhaps? Commented Mar 11, 2016 at 14:01
• Have a look here: mathematica.stackexchange.com/a/63570/19176 Commented Mar 11, 2016 at 14:03
• Perfect! Thanks a ton! :) Commented Mar 11, 2016 at 14:11