Seaborn Barplot - Displaying Values

后端 未结 6 788
不知归路
不知归路 2020-11-27 14:39

I\'m looking to see how to do two things in Seaborn with using a bar chart to display values that are in the dataframe, but not in the graph

1) I\'m looking to displ

6条回答
  •  盖世英雄少女心
    2020-11-27 14:53

    plt.figure(figsize=(15,10))
    graph = sns.barplot(x='name_column_x_axis', y="name_column_x_axis", data = dataframe_name ,  color="salmon")
    for p in graph.patches:
            graph.annotate('{:.0f}'.format(p.get_height()), (p.get_x()+0.3, p.get_height()),
                        ha='center', va='bottom',
                        color= 'black')
    

提交回复
热议问题