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

I have an image assigned to myPicture

myPicture =

enter image description here

 Image[myPicture, ImageSize -> {500, 300}]

I get result like this, after evaluation:

enter image description here

My problem is that the image is not fitted to the rectangle. How can I solve that one?

share|improve this question
I think you are over constraining your requirements since the aspect ratio of images is different than the aspect ratio of the space you to put it into. – m_goldberg Nov 8 '12 at 8:33
up vote 2 down vote accepted
ImageResize[myPicture, {500, 300}]


Show[myPicture, ImageSize -> {500, 300}, AspectRatio -> 3/5]

or, more generally,

Show[myPicture, ImageSize -> {500, 300}, AspectRatio -> Full]


share|improve this answer
I hope you don't mind. I just did not want to waste a new answer to such a one-liner. – István Zachar Nov 8 '12 at 9:44
@IstvánZachar No problem - I prefer answers to comments anyway :) – cormullion Nov 8 '12 at 9:45
A good preference, indeed :) – István Zachar Nov 8 '12 at 9:56

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.