我想在Seaborn生成的因子图中添加数据标签。下面是一个例子:
import pandas as pd
from pandas import Series, DataFrame
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
titanic_df = pd.read_csv('train.csv')
sns.factorplot('Sex',data=titanic_df,kind='count')
如何将“count”值添加到图表上每个栏的顶部?
以上来自@nickil maveli的回答非常好。 这只是为了在向barplot添加数据标签时(按照@user27074的注释中的要求)添加一些参数的清晰性
你可以做些更简单的事
你可以这样做:
相关问题 更多 >
编程相关推荐