I have the following dataframe:
dataT = [{'Record_ID': 10, 'Timepoint': 1, 'Value1':30,'Value2':15, "Improvement" : 1 }, {'Record_ID': 10, 'Timepoint': 2, 'Value1':30,'Value2':30, "Improvement" : 1 },
{'Record_ID': 12, 'Timepoint': 1, 'Value1':40,'Value2':10 , "Improvement" : 2 }, {'Record_ID': 12, 'Timepoint': 2, 'Value1':30,'Value2':30, "Improvement" : 2 },
{'Record_ID': 13, 'Timepoint': 1, 'Value1':70,'Value2':30 , "Improvement" : 3 }, {'Record_ID': 13, 'Timepoint': 2, 'Value1':25,'Value2':40 , "Improvement" : 3},
{'Record_ID': 11, 'Timepoint': 1, 'Value1':60,'Value2':50 , "Improvement" : 1 }, {'Record_ID': 11, 'Timepoint': 2, 'Value1':35,'Value2':45, "Improvement" : 1 }]
data = pd.DataFrame(dataT)
#plot:
import matplotlib.pyplot as plt
sns.set_style("darkgrid")
colors = dict({1: "green",
2:"red",
3:"orange"})
expVarPC1 = my_pcoa.eigvals.PC1/my_pcoa.eigvals.sum()
fig, ax = plt.subplots(figsize=(24, 16))
sns.scatterplot(x =data['Value1'], y= data['Value2'],style=data["Timepoint"], hue=data["Improvement"], s=200,
palette=colors)
plt.legend(title='', title_fontsize=20, fontsize=20, markerscale=2., scatterpoints=1, )
plt.xlabel("Val1" , fontsize=22)
plt.ylabel("Val2 ", fontsize=22)
plt.title("samples T1 & T2 ", fontsize='40')
plt.show()
The resulting plot: dataframe Data
I would like to add arrows between each time point 1 and 2 sample for each record id, so far I haven't found anything that works, any help would be appreciated.
P.s. I would also like to colour the arrows the same as the markers
