ColorFunction and/or ColorOutput - mkdk
- To: mathgroup@smc.vnet.net
- Subject: [mg10733] ColorFunction and/or ColorOutput - mkdk
- From: "decker, mark a" <ormad@orntsrv103.micro.lucent.com>
- Date: Mon, 2 Feb 1998 00:44:26 -0500
I would like to color certain regions of a density plot. I have been working with ColorFunction unsuccessfully so far. I was wondering if someone might be able to help me without taking too much of their time. I would also like to clean up all the errors I am generating, by either defining my function in a different way OR turning off a few of the error codes. I realize there are undefined regions in the plot. Here it is. It was simple enough I didn't even define functions. cond = {alpha -> Pi/6, lambda -> 2.15, Ei -> Ep - Es} R = lambda Ei Sqrt[ 1 - (Ep/Ei) Sin[alpha]^2 ] DensityPlot[R /. cond, {Ep, 0, 6}, {Es,0,4.5}, Mesh->False, PlotRange->{0,1}, PlotPoints->100 ] What I would like to do is the following: R<0 be black R=0 some bright color. 0<R<1 be shaded where R~0 is dark and R~1 is light. R>1 be white R undefined be some other color. I'm sure this is possible. And I don't need a full solution. But maybe an example using an IF statement with ColorFunction. I have come pretty close so far, but the shading from dark to light is screwed up and doesn't seem linear with R from 0 to 1. What algorithm does GrayLevel use to normalize it with the function from 0 to 1? Does anybody know? That might help. Thanks!
- Follow-Ups:
- Re: ColorFunction and/or ColorOutput - mkdk
- From: Your Name <seanross@worldnet.att.net>
- Re: ColorFunction and/or ColorOutput - mkdk