The imagesc
function can take arguments which dictate where the image is drawn, so I would use this. Here's an example of imagesc
being drawn on top of a plot:
% Draw plot
vals=rand(2,100);
plot(vals(1,:),vals(2,:),'x');
hold on;
% Draw image
im=imread('moon.tif');
xs=linspace(0.1, 0.2, size(im, 2) );
ys=linspace(0.1, 0.2, size(im, 1) );
colormap gray;
imagesc(xs,ys,im)
Which looks like this:
Note the first two arguments to imagesc
which define the range over which the image is drawn. Obviously you'll want to change the arguments to linspace
, which will define the position and size of the image, and you'll need to take account for the aspect ratio if the image isn't square, but hopefully this will get you along the right lines.