This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

ColorFunction

ColorFunction
is an option for graphics functions that 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.
  • Combinations of directives can be specified using Directive.
  • 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:
Color the surface by height:
In[1]:=
Click for copyable input
Out[1]=
 
Use predefined gradients:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
Color a curve:
In[1]:=
Click for copyable input
Out[1]=
 
Color a matrix:
In[1]:=
Click for copyable input
Out[1]=
Define a one-dimensional color function:
Use predefined color gradients from ColorData:
New in 2 | Last modified in 6