I am currently working on a multi line graph, however I can't figure out how to label data point on my graph. I have tried to annotate it but somehow my code doesn't work. Any advice please?
import numpy as np
import matplotlib.pyplot as plt
data={'Time':['Start','1W','2W','3W','1M','2M','3M','6M','8M'],
'40℃':[30,50,60,50,55,None,56,67,75],
'25℃':[30,None,None,None,35,43,None,53,67]}
df=pd.DataFrame(data,columns=['Time','40℃','25℃'])
print(df)
# Change the style of plot
plt.style.use('seaborn-darkgrid')
# set figure size
my_dpi=96
plt.figure(figsize=(800/my_dpi, 600/my_dpi), dpi=my_dpi)
# plot multiple lines
xs=np.arange(9)
series1=np.array(data['40℃']).astype(np.double)
s1mask = np.isfinite(series1)
series2 = np.array(data['25℃']).astype(np.double)
s2mask = np.isfinite(series2)
plt.plot(xs[s1mask], series1[s1mask], marker='o', markersize=5,linewidth=1, alpha=0.6)
plt.plot(xs[s2mask], series2[s2mask], marker='o', markersize=5,linewidth=1, alpha=0.6)
# Change x axis limit
plt.xlim(-0.5,8.5)
plt.ylim(25,80)
# Add titles
plt.title("Viscosity", loc='center', fontsize=12, fontweight=0, color='black')
plt.xlabel("Time",fontsize=12)
plt.ylabel("Temperature(°C)",fontsize=12)
# Adjust tick of y-axis
plt.yticks(np.arange(25,80,5))
# Show the graph
plt.show()