User defined color function for discrete data set?
- To: mathgroup at smc.vnet.net
- Subject: [mg105777] User defined color function for discrete data set?
- From: Porscha Louise McRobbie <pmcrobbi at umich.edu>
- Date: Fri, 18 Dec 2009 06:23:57 -0500 (EST)
Hello,
If I define a complex function, I can easily plot its modulus and
color it according to its argument as:
f[x_] := Exp[-x^2] Exp[2 I x]
Plot[Abs[f[x]], {x, -3, 3}, Filling -> Axis,
ColorFunction -> (Hue[ Arg[f[#1]]] &)]
I'd like to do the same thing, but now with a discrete set of points.
If I have the following plot:
xlist = Table[j, {j, -3, 3, .1}];
flist = Table[f[j], {j, -3, 3, .1}];
data = Thread[{xlist, flist}];
ListLinePlot[Thread[{xlist, Abs[flist]}], Filling -> Axis]
Using a built-in color scheme is easy, I just add the option
ColorFunction->scheme. But how can I define my own color function? Is
it possible to use ColorData somehow?
My apologies if this is in the Documentation, I cannot seem to find a
relevant example.
Thanks!
Porscha