[英]How do I arrange my data and plot x-axis correctly?
Assuming your data frame is named df and you don't require the year to show up, Try using假设您的数据框名为 df 并且您不需要显示年份,请尝试使用
df = df.reset_index()
df = df.set_index('Flexible working Age')
Then drop the year and plot the bar graph normally.然后正常删除年和 plot 条形图。 You can do this using a copy of the data frame as well
您也可以使用数据框的副本来执行此操作
data = df.copy()
In case you want to retain the original data frame.如果您想保留原始数据框。
You can label the bars on top with the year if you want the year to be seen.如果你想看到年份,你可以 label 顶部的酒吧与年份。
Use a loop and use使用循环并使用
plt.annotate()
I don't have any of your code so I can't help you anymore.我没有你的任何代码,所以我不能再帮你了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.