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 know how to import an image into Mathematica using the Import command. The original image can come from anywhere, but call this image "myimage" after importing into Mathematica

Now my problem is how to insert this image at the point with coordinates (2,3) in the XY-plane. I know how to insert certain text at a prescribed place, but with imported images, I am not sure how to do it.

Any help will be greatly appreciated!

share|improve this question
    
Welcome to Mathematica.SE! Please consider registering your account. It'll open up the way to using many features of this site, such as editing your question at any later time and commenting on answers for clarifications. –  Szabolcs Jul 3 '12 at 18:31

2 Answers 2

You need Inset:

im = Image@Graphics[{Circle[{0, 0}, 0.1]}];
Plot[x, {x, 0, 20}, Epilog -> Inset[im, {15, 15}]]

Mathematica graphics

share|improve this answer

In Graphics expressions, you can use Inset in a very similar way to Text:

img = Import["http://i.stack.imgur.com/GDnKs.png"]

Graphics[Inset[img, {2, 3}], Frame -> True]

Mathematica graphics

The third argument of Inset will control which point in it will be positioned at the given coordinates.

For more precise control, you can use Raster:

Graphics[
 Raster[ImageData[img, DataReversed -> True], {{0, 0}, {1, 1}}], 
 Frame -> True]

Raster is just like Rectangle, but it renders an image inside. Don't forget to use DataReversed -> True in ImageData to get the image data in a format compatible with Raster.

share|improve this answer
    
Thnak you very much to all of you! I will try and let you know. –  tim Jul 3 '12 at 18:37

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.