Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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}]];
ImageDimensions[%]

{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
    
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
1  
This should work ArrayPlot[RandomReal[1,{100,100}],PixelConstrained->True,ImageSize->{100,100}] –  sebhofer Jul 19 '13 at 9:25
add comment

marked as duplicate by rm -rf 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.

1 Answer

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
add comment

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