Call the ax.bar method to plot the "Gold" column as a function of the country. Use the ax.set_xticklabels to set the x-a

动态 未结 0 98
小小草
小小草 LV1 2023年9月23日 23:40 发表
下面是完整代码: ```python fig, ax = plt.subplots() # Plot a bar-chart of gold medals as a function of country ax.bar(medals.index, medals["Gold"]) # Set the x-axis tick labels to the country names and rotate them by 90 degrees ax.set_xticklabels(medals.index, rotation=90) # Set the y-axis label ax.set_ylabel("Number of medals") plt.show() ```
收藏(0)  分享
相关标签: 智能问答
问题没解决?让AI助手帮你作答 AI助手
0个回复
  • 消灭零回复