I am trying to make a connected scatter plot. I was able to make this simple plot, but I want to add a line between the points within each group. I tried the linestyle
argument (in below code), but this did not connect the dots. How can I add this line?
fig, ax = plt.subplots()
colors = {'RMSE':'red', 'MAE':'green', 'R2':'blue'}
grouped = metrics_df.groupby('metric')
for key, group in grouped:
group.plot(ax=ax, kind='scatter', x='num_features', y='score', label=key, color=colors[key], linestyle='solid')
plt.show()