MATLAB: How to plot an image(.bmp) in a graph

graphimage

Hello,
I have a 2-D plot and on the top right corner of the plot, I want to display an image (picture).
Is there any way to do this?

Best Answer

You can use image()
image(x,y,C), where x and y are two-element vectors, specifies the range of the x- and y-axis labels, but produces the same image as image(C). This can be useful, for example, if you want the axis tick labels to correspond to real physical dimensions represented by the image. If x(1) > x(2) or y(1) > y(2), the image is flipped left-right or up-down, respectively. It can also be useful when you want to place the image within a set of axes already created. In this case, use hold on with the current figure and enter x and y values corresponding to the corners of the desired image location. The image is stretched and oriented as applicable.