如何将收入值添加到Python可视化中每个条形图的顶部?
这是我到目前为止写的,但我不确定如何在每个栏的顶部添加值如何将收入值添加到Python可视化中每个条形图的顶部?,python,python-3.x,matplotlib,bar-chart,Python,Python 3.x,Matplotlib,Bar Chart,这是我到目前为止写的,但我不确定如何在每个栏的顶部添加值 # Visualize monthly revenues for top 4 sources. top_four.pivot(index = 'month', columns = 'source_id', values = 'revenue').plot(kind='bar', figsize=(20, 10),
# Visualize monthly revenues for top 4 sources.
top_four.pivot(index = 'month', columns = 'source_id', values = 'revenue').plot(kind='bar',
figsize=(20, 10),
color=['cornflowerblue','salmon','powderblue','darkseagreen'],
rot=0)
plt.title("Monthly Revenue for Top 4 Source ID's", y = 1.03, fontsize=30)
plt.xlabel("Date [Month]", labelpad=24, fontsize=20)
plt.ylabel("Revenue in USD", labelpad=20, fontsize=20)
查看本例中的自动标签。这回答了你的问题吗?