Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

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

This question already has an answer here:

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

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

{360, 273}

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

share|improve this question

marked as duplicate by R. M. Jul 20 '13 at 16:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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}]]
share|improve this answer
Thanks a lot! Did the job. – ErikP Jul 19 '13 at 14:14

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