Seaborn Countplot : Display only n most frequent categories
问题 I have a python array listing all occurences of string labels. Let's call it labels_array. Using seaborn as sns I d like to show a countplot of this array : sns.countplot(labels_array) This works, but as they are too many different labels in my array, the outpout doesnt look good. Is there a way to display only the n most frequent labels. 回答1: Although countplot should in principle know the counts and hence allow to show only part of them, this is not the case. Therefore, the use of countplot