Reputation: 431
Relatively simply issue here but I have a simple dataframe like so:
df.head()
trigger count
0 task_appeared 8677
1 status 7410
2 task_created 4046
3 custom_field 2550
4 on_due_date 2116
And I want to print out a descending seaborn visual to show the list of trigger types by count in descending order. My code is as follow:
sns.countplot(x = "trigger", data = df,palette = 'plasma')
plt.title("Trigger Popularity")
plt.ylabel("Count of Triggers")
plt.xlabel("Trigger Type")
plt.xticks(rotation=90)
However I just get the following visual. It does not show the correct value counts for each trigger in descending order as listed from my original dataframe. I dont know why the y-axis only shows values from 0 to 1 when it should show the value specified by the count column of the DF
Upvotes: 1
Views: 45
Reputation: 2615
Already you did the count of each trigger types
so you can use barplot
sns.barplot(x="trigger", y="count", data=df)
plt.xticks(rotation=90)
plt.title("Trigger Popularity")
Output:
Upvotes: 2