I need to position a certain part of a photographic image at the origin of a plot in Graphics. I am currently using Inset[image, {0,0}, {xpos,ypos}, size]
and varying xpos and ypos until it looks right. This is time consuming considering the number of images I am adding. Is there a way to select the desired point on each image and then obtain its coordinates within that image so that I can determine xpos and ypos exactly. Any advice would be welcome.
$\begingroup$
$\endgroup$
2
1 Answer
$\begingroup$
$\endgroup$
1
I'm not 100% sure what you're looking for, but it can probably done using LocatorPane
and Dynamic, e.g. like this:
img = ExampleData[{"TestImage", "CarAndAPC"}];
pt = {0, 0};
Row[{
LocatorPane[Dynamic[pt], img],
Dynamic[Plot[Sinc[x], {x, -10, 10},
Prolog -> {Inset[img, {0, 0}, pt]}, ImageSize -> 300]],
Dynamic[pt]}]
-
$\begingroup$ That is what I need, nikie. I will also try Szabolcs' suggestion to use Raster for greater precision with the alignment. This was very helpful. $\endgroup$– JCFCommented Sep 13, 2016 at 19:33
Axis->True
so that you can determin the position on one glimps. $\endgroup$Raster
. Unlike Inset, it uses standard graphics coordinates and makes it possible to align an image with other graphics elements with perfect precision. $\endgroup$