Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Visualization and Graphics > Graphics Options & Styling > Colors >
Mathematica > Data Manipulation > Image Processing & Analysis > Color Processing > Colors >
Mathematica > Visualization and Graphics > Symbolic Graphics Language > Graphics Directives > Colors >

ColorFunction

ColorFunction
is an option for graphics functions which specifies a function to apply to determine colors of elements.
  • With ColorFunction->func, the arguments supplied to func are as follows:
  • With the usual default setting ColorFunctionScaling->True, all arguments supplied to func are scaled to lie in the range 0 to 1.
  • The list of possible color function names is given by ColorData["Gradients"].
  • Combinations of directives can be specified using Directive[g1, g2, ...].
  • In 3D graphics, ColorFunction by default specifies diffuse colors for surfaces.
Color the surface by height:
Use predefined gradients:
Color a curve:
Color a matrix:
Define a one-dimensional color function:
Use predefined color gradients from ColorData:
New in 2 | Last modified in 6
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team