Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose you have the following:

tt = Table[{i, j}, {i, 0, 10}, {j, 0, 10}]

The table tt is a matrix of pairs, {i, j}. Now you issue


you get a nice image with the top row and the rightmost column white.

How does ArrayPlot work in this case? I tried to look into the ColorFunction documentation but I was not able to actually understand how the system is working. I am curious to find an explanation.

share|improve this question

In this case GrayLevel[g,a] is used where a is the alpha-value. You can see this easily by drawing a rectangle below your plot:

tt = Table[{i, j}, {i, 0, 10}, {j, 0, 10}];
Show[Graphics[{Red, Rectangle[{0, 0}, {11, 11}]}],

Mathematica graphics

As suggested by Kuba here an additional example:

Row[{ArrayPlot[tt], ArrayPlot[tt, ColorFunction -> (GrayLevel[1-#] &)]}]

Mathematica graphics

And finally, ArrayPlot creates a Raster and this information can be found under Scope -> Raster Styling section.

share|improve this answer
Thanks. That was very helpful. Took me a bit more, but I think I grokked it. There should be a bit more of explanation directly in the ArrayPlot documentation. – Marco Antoniotti Jun 6 '14 at 12:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.