Answers for "sns countplot show count"

0

display values on countplot

plt.figure(figsize=(12,8))
ax = sns.countplot(x="AXLES", data=dfWIM, order=[3,4,5,6,7,8,9,10,11,12])
plt.title('Distribution of Truck Configurations')
plt.xlabel('Number of Axles')
plt.ylabel('Frequency [%]')

for p in ax.patches:
        ax.annotate('%{:.1f}'.format(p.get_height()), (p.get_x()+0.1, p.get_height()+50))
Posted by: Guest on June-30-2020
0

sns countplot show count

# Declare graph/plot variable
sample_plot = sns.countplot(df['Sample'])

#This display the values on top of the bars
for p in sample_plot.patches:
        sample_plot.annotate('{}'.format(p.get_height()), (p.get_x()+.35, p.get_height()+20))
Posted by: Guest on September-11-2021

Python Answers by Framework

Browse Popular Code Answers by Language