Re: Placing images in the coordinate system?
- To: mathgroup at smc.vnet.net
- Subject: [mg103746] Re: [mg103712] Placing images in the coordinate system?
- From: "David Park" <djmpark at comcast.net>
- Date: Sun, 4 Oct 2009 05:38:12 -0400 (EDT)
- References: <33341602.1254576310852.JavaMail.root@n11>
Dave, As usual, I would do try this with the Presentations package, but you could probably do it without the package with a little more work and perhaps less intuitively. I would draw everything on a "piece of paper" and not use an Axis or Frame as it is difficult to control the overall image dimensions with them. Then you would need a mapping from your {long, lat} coordinates to {x,y} on the piece of paper. You would have to have some map projection for the 2D image of the moon surface. It might be difficult to find what the projection was for the image you have. Presentations has a routine DrawingTransform that will transform any graphics you draw, say in the {long, lat} coordinates, to the {x,y} coordinates. It also has free standing scales, XTickLine and YTickLine that you can place on the piece of paper, say just outside the boundaries of the moon map. That way you get your axes. You could also use DrawingTransform on these so they would give {long,lat} coordinates on the {x,y} plot. So assuming we can either Rasterize the moon image, or use Inset, to place it at specific coordinates and scale on the piece of paper, the plotting statement would look something like this: Draw2D[ {moonimage, {your graphics, XTickLine[...], YTickLine[...]} /. DrawingTransform[Function[{long,lat}, xcoordinate], Function[{long,lat}, ycoordinate]], Text labels placed on the piece of paper}, Options...] David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ From: Dave [mailto:uber.daveb at gmail.com] Hello, Using Mathematica 7.0, how can I take an image and give it a position and scale, so that it can be combined with other graphics? Here's what I am trying to do: I would like to have an image map of the moon as the background for my plot or contour plot. I want to be able to plot points by their lat,lon positions and have them appear at the correct points on the map. I came up with a hack to do this by rasterizing the plot using Image[] so that it is the same resolution as the moon image, and then combining the two images. (I found a similar technique here: http://mathgis.blogspot.com/2007/12/fun-with-image-overlay.html) The problem is this does not work if the plot has Axes->True, because some space is used for the axes, so the coordinate systems don't match exactly anymore. I really would like to have both Axes and the image together. Is there a good way to do this? Thanks, Dave