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.

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

1 Answer

up vote 2 down vote accepted
ImageResize[myPicture, {500, 300}]

or

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

or, more generally,

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

butterfly

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

Your Answer

 
discard

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.