0

Here is what I tried to do. It displayed the image as the background but it did not display the x,y plot. I also want to use another picture for my plot points.

x=[0,1,2,3,4,5]       
y=[0,1,2,3,4,5]    

im = plt.imread('testimage.png')

implot = plt.imshow(im)

plt.plot(x,y,'o',color='black')

plt.show()

Thanks.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
  • I see that it works, but when you draw the image each unit in the plot equals one pixel, so if your image is 512x512 and you plot the points x and y these will be located in the upper left. – eyllanesc Nov 07 '17 at 21:50
  • yes, that is endeed what happens. any idea how to not have the x and y at the upper left corner? thanks. – Ahmed Sameh Wagih Nov 07 '17 at 22:06
  • 2
    Possible duplicate of [Adding a background image to a plot with known corner coordinates](https://stackoverflow.com/questions/15160123/adding-a-background-image-to-a-plot-with-known-corner-coordinates) – eyllanesc Nov 07 '17 at 22:08
  • You code needs the import to tell what `plt` is. See https://stackoverflow.com/help/mcve. If the missing import is for matplotlib, add the tag so matplotlib experts are more likely to look at this. – Terry Jan Reedy Nov 07 '17 at 22:50

0 Answers0