Matplotlib: Plot countplot for two or more column on single plot

Viewed 41320

My dataFrame, df:

Sno | Attribute_1   | Attribute_2   | Attribute_3
__________________________________________________
1   | option_1      | option_3      |option_2
2   | option_1      | option_1      |option_1
3   | option_2      | option_2      |option_2
4   | option_1      | option_1      |option_3
5   | option_3      | option_2      |option_2
6   | option_3      | option_3      |option_1
7   | option_1      | option_3      |option_2

Here Attribute_1, Attribute_2 and Attribute_3 contains categorical data - option_1 or option_2 or option_3 for each of the rows.

I want to create a count plot on the same plot for all the attributes. I am able to do it for one column by:

sns.countplot(x="Attribute_1", data=df);

I can individually create for each of the attributes, but what I am looking for it that on the same plot I can have count plot for all the attributes. i.e X-axis will have attributes, and each attribute will have three count plot.

1 Answers
Related