[Mathematica]Frustratedhow to color a plot according to the values?

  • Mathematica
  • Thread starter hanson
  • Start date
  • #1
319
0

Main Question or Discussion Point

Hi all.
I have been searching over the web for some time, kind of frustrated...
I would like to plot the contourplot of a function, and I would like the contourplot to be colored.
The rule is that...the negative values should be blue in colors and the positive values should be red in colors, but I also want some gradient between these two limits...
I suppose this can be quite easily done, but I still don't know how to do that...
Anyone knows? Please help. Thanks.
 

Answers and Replies

  • #2
598
0
Try playing with the contour option:
contour-># of contour lines
and contourstyle

they should be in the help context
 
  • #3
167
3
ColorFunction

http://documents.wolfram.com/mathematica/functions/ColorFunction [Broken]

I can't remember the syntax (haven't had a Mathematica license in years), but you want something like ColorFunction -> (RGBColor[1.0#, 0.0, (1.0-1.0#)]&) or similar - you can fiddle with the constants to change the parametric variation, even make it nonlinear if you want.
 
Last edited by a moderator:
  • #4
319
0
Thanks for the replies!
I have found a user-written Mathematica notebook which do exactly what i want. Thanks.
 

Related Threads for: [Mathematica]Frustratedhow to color a plot according to the values?

Replies
1
Views
18K
Replies
0
Views
3K
Replies
3
Views
8K
Replies
1
Views
4K
Replies
6
Views
7K
Top