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 > ColorRules >
Mathematica > Data Manipulation > Image Processing & Analysis > Color Processing > Colors > ColorRules >
Mathematica > Visualization and Graphics > Symbolic Graphics Language > Graphics Directives > Colors > ColorRules >

ColorRules

ColorRules
is an option for ArrayPlot which specifies how colors of cells should be determined from values.
  • The rules given by ColorRules are applied to the value of each cell.
  • If the result from applying ColorRules is None, the background color will be used.
Use color rules for ArrayPlot:
Use color rules for MatrixPlot:
Use color rules for ArrayPlot:
In[1]:=
Click for copyable input
Out[1]=
 
Use color rules for MatrixPlot:
In[1]:=
Click for copyable input
Out[1]=
ColorRules can involve patterns:
If no explicit color rules apply, the default ArrayPlot coloring is used:
Color rules are applied before color function:
Cases specified as None are rendered in the background color:
Modular operations tables:
Highlight cells where the GCD is 1:
Color a cellular automaton pattern:
New in 5.1
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF