Say I am plotting a set of points with an image as a background. I've used the Lena image in the example:
import numpy as np
import matplotlib.pyplot as plt
from scipy.misc import imread
np.random.seed(0)
x = np.random.uniform(0.0,10.0,15)
y = np.random.uniform(0.0,10.0,15)
img = imread("lena.jpg")
plt.scatter(x,y,zorder=1)
plt.imshow(img,zorder=0)
plt.show()
This gives me .
My question is: How can I specify the corner coordinates of the image in the plot? Let's say I'd like the bottom-left corner to be at x, y = 0.5, 1.0
and the top-right corner to be at x, y = 8.0, 7.0
.