ListPlot and ColorFunction [duplicate]

I've been searching for the use of ColorFunction as an Option for ListPlot, but haven't found anything about it in the documentation. When trying the code

ListPlot[
RandomReal[5, {10}]
, ColorFunction -> Hue[#1, #2, 1] &
]


I get the error message

ListPlot::nonopt: "Options expected (instead of ColorFunction->Hue[#1,#2,1]&) beyond position 3 in ListPlot[{2.14801,2.18933,<<6>>,3.48,0.566812},ColorFunction-><<1>>&]. An option must be a rule or a list of rules."


Is it possible, and if so, how, to use ColorFunction with ListPlot? What are the arguments of the function, then?

Thanks for all help, as always!

-

marked as duplicate by rm -rf♦Oct 31 '13 at 20:24

The problem here is that you haven't used parentheses to group the function. It should be ColorFunction -> (Hue[#, #2, 1]&). See Parentheses in pure functions: # & vs. ( # &) and Using several anonymous functions mixed together for more info. Regarding your actual question, ListPlot doesn't accept a ColorFunction without Joined -> True (or ListLinePlot). Your solution is to use either of these and convert the lines to points as in this answer –  rm -rf Oct 31 '13 at 18:47
Either way, it's a duplicate of one of these — you can decide which :) –  rm -rf Oct 31 '13 at 18:48
@rm -rf: Thanks for the link, that's great! –  Gabriel Oct 31 '13 at 19:17

{ListPlot[Sinc[Range[0, 10, 0.1]], ColorFunction -> Function[{x, y}, Hue[x]]],