MATLAB: How to Place an image over existing plots

image insertionMATLABplotting

Hello, I have some graphs in Matlab over which I want to insert a small image. I do not want to cover the graphs completely, and want to know how to specify the exact position for overlaying this image onto the existing plots. I have used imread to read the file, but cannot seem to figure out imshow to display the image properly where I would like it to be.

Best Answer

Hi Ashley,
Run this:
figure
plot((1:10).^2)
axes('pos',[.1 .6 .5 .3])
imshow('coins.png')
The axes command sets up a new set of axes on top of the x^2 plot, with the position of those axes as follows:
[bottomleftcornerXposition bottomleftcornerYposition width height]