The code below with commented "offset annotation" lines produce the image below, however,
the annotation is not neat; I would like to offset these annotations to make them look neat; hence the code lines with "offset annotation", when uncommented, are supposed to offset (adjust "MN={}" a little to the left) these annotations, instead, it produces the same graph without any annotations. Is any solution for this? I noted that this problem is similar to Annotate Time Series plot in Matplotlib, but I could not adapt the answer to this problem.
import datetime
from matplotlib import pyplot as plt
#create time points
datetime1 = datetime.timedelta(hours=0,minutes=0,seconds=19)
datetime2 = datetime.timedelta(hours=0,minutes=4,seconds=12)
datetime3 = datetime.timedelta(hours=0,minutes=19,seconds=50)
datetime4 = datetime.timedelta(hours=0,minutes=57,seconds=3)
datetime5 = datetime.timedelta(hours=2,minutes=20,seconds=20)
datetime6 = datetime.timedelta(hours=5,minutes=57,seconds=45)
points = [10568,40297,85357,149339,237323,357508]
times = [str(datetime1),str(datetime2),str(datetime3),str(datetime4),str(datetime5),str(datetime6)]
machine_numbers = [1.5,2.4,3.3,4.2,5.1,6.0]
fig, ax = plt.subplots()
ax.set_title("produced coins vs time elapsed")
ax.plot(times,points)
for machine_number,time,point in zip(machine_numbers,times,points):
#offset the coin annotation to look better
#indexts = time.split(":")[-1] #offset annotation
#indexts_m = float(indexts)-1 #offset annotation
#time = time.replace(indexts,str(indexts_m)) #offset annotation
#insert annotions
ax.annotate(r'$MN={}$'.format(machine_number),(time,point))
#Legends
ax.set_xlabel("Time [hours:minutes:seconds]")
ax.set_ylabel("Earned coins")
plt.show()