I'm drawing a picture using Matplotlib:
plt.imshow(bild)
plt.show()
How do I add a Marker to this (eg. red dot / arrow) using the coordinates of the image?
Draw Markers on an Image Insert a plus (+) marker. RGB = insertMarker(I,[147 279]);
You can also use plt.scatter
to add a red dot to mark the point. Building on the previous answer's example code:
import matplotlib.pyplot as plt
import numpy as np
img = np.random.randn(100, 100)
plt.figure()
plt.imshow(img)
plt.annotate('25, 50', xy=(25, 50), xycoords='data',
xytext=(0.5, 0.5), textcoords='figure fraction',
arrowprops=dict(arrowstyle="->"))
plt.scatter(25, 50, s=500, c='red', marker='o')
plt.show()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With