I am trying to plot some values grouped by a column and compare them. I used
for key, grp in df.groupby([gcol]):
ax = grp.plot.line(ax=ax,linestyle="--",marker="o", x='steps', y='rouge_score', label=key, color=colors[gi])
gi += 1
if gi > len(colors) - 1: gi = 0
name += key + "_"
ax.set_xticks(df["steps"].unique())
ax.set_title(name)
However, as you see in the picture, it connects the points in order of y axis, while I want to connect them in order of x axis. For example for the red line it must first be connected to the point at 4500 and then the point at 9000
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.