# Plotting with ColorFunction -> GrayLevel - no black

This is probably a fairly trivial question, yet I have been unable to find an answer - help would be much appreciated! :)

I am trying to plot a 28 x 28 matrix (tabulated data given here), containing continuous pixels values on the interval [0;1]. I am using MatrixPlot and ColorFunction -> GrayLevel, so that 0 comes out as black and 1 as white, and all values inbetween will cover the gray spectrum. MatrixPlot produces a lovely 28 x 28 matrix plot - however, for some reason it uses a medium gray for 0, and scales the remaining values accordingly on the gray spectrum, with 1 still being white.

This is the code used:

input1 = Get["http://pastebin.com/raw.php?i=PP2t8tp6"];
MatrixPlot[input1, ColorFunction -> GrayLevel, Mesh -> None, AspectRatio -> 1/1, ImageSize -> 300]


The resulting image:

Adding a file extension (.dat, .csv, .txt) and adding separators made no difference - I also tried forcing the color spectrum with ColorRule, but no luck.

-
I have nowhere to upload the file for linking - but the data is of the form described above, outputted from my program with simple spaces " " as separators and '\n' as newline. :) –  nielsen Apr 28 '14 at 12:43
Please prodive your inputfile, it will be easier for everyone. You can paste it in your question or on pastebin. The simplest way is to copy/paste input1 on pastebin. –  Öskå Apr 28 '14 at 12:49
Seems a little space consuming - but I've added it to the post. :) –  nielsen Apr 28 '14 at 12:54
Try ColorFunctionScaling -> False. –  billisphere Apr 28 '14 at 12:57
Spot on, that worked - thank you very much! :) –  nielsen Apr 28 '14 at 12:59

You need to prevent scaling of the data with the option ColorFunctionScaling -> False
data = Get["http://pastebin.com/raw.php?i=PP2t8tp6"];