Order matters a lot here. If you do the image after the plot, you won't be able to see the plot because it will go behind the image. You can use theuistack function to fix this, but it's usually easier to just create them in the correct order.
Theimage function behaves differently depending on whether you set CData (as I did above) or just pass the data in like this:
image(img,'XData',[4 8],'YData',[-1/4 1/4])
When you call image this way, it's going to set a bunch of properties on the axes such as YDir and the limits. You can override all of those, but you'll probably find it simpler to use the CData form when you're doing this sort of thing.
Best Answer