Mathematica > Visualization and Graphics > Graphics Options & Styling > Colors > ColorFunction >
Mathematica > Data Manipulation > Image Processing & Analysis > Color Processing > Colors > ColorFunction >
Mathematica > Visualization and Graphics > Symbolic Graphics Language > Graphics Directives > Colors > ColorFunction >

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
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF