Reputation: 42389
I need to load an image file with matplotlib
and see the coordinates of points within it, as if it were a simple x,y
scatter plot.
I can assume that the x axis extension is [0, 1]
, and the y axis follows the same scaling. I can load the above image file with
from PIL import Image
im = Image.open("del.png")
im.show()
but this uses ImageMagick (I'm on a Linux system) to display the image, and no coordinates are shown in the bottom left part of the plot window as would for a simple data plot:
Upvotes: 1
Views: 2459
Reputation: 2448
Use pyplot for that:
from matplotlib import pyplot as plt
plt.imshow(plt.imread('del.png'))
Upvotes: 2