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

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