# How can I make ArrayPlot use one pixel per plot point? [duplicate]

If I ArrayPlot an {1200,1600} matrix, the result is a plot with ImageDimensions of {360,273} pixels:

ArrayPlot[RandomReal[{0, 1}, {1200, 1600}]];
ImageDimensions[%]


{360, 273}

I can't find an scaling option. How can I get a plot with a resolution of {1200,1600}?

-

## marked as duplicate by rm -rf♦Jul 20 '13 at 16:12

ImageDimensions returns the number of displayed pixels not the number of blocks used by ArrayPlot –  sebhofer Jul 19 '13 at 9:07
But I would like to get an image of the same dimensions as the original matrix. How can I get that? –  ErikP Jul 19 '13 at 9:16
This should work ArrayPlot[RandomReal[1,{100,100}],PixelConstrained->True,ImageSize->{100,100}] –  sebhofer Jul 19 '13 at 9:25

You're looking for PixelConstrained -> 1:

ArrayPlot[RandomReal[{0, 1}, {500, 500}],
Frame -> False, PixelConstrained -> 1]


You should know that when it says it's pixel-constrained, it really means it. You can't resize the output pattern because it's being matched pixel-by-pixel to the physical pixels of your monitor. This may sound like a good thing but some patterns can appear too "harsh" because of this.

And remember that you always have the option of using Image:

Image[RandomReal[{0, 1}, {500, 500}]]

-
Thanks a lot! Did the job. –  ErikP Jul 19 '13 at 14:14