0

sample data:

list1 = ['C','C1,C2','A9','GV5','A6','A3']
arr1 = np.random.default_rng().uniform(low=5,high=10,size=[6,3])
df = pd.DataFrame(arr1,index = list1, columns=["A","B","C"])

I can make a barplot to compare a single category of data, but I'm not sure how to display multiple categories at once in a side by side; showing the values of columns A, B, and C side by side for each index value.

I tried adding more into the y designation, but it was fruitless.

ax = sns.barplot(data = df, x = df.index, y='A') ##chart of only one category
ax = sns.barplot(data = df, x = df.index, y=('A','B','C')) ##doesn't work
Baaridi
  • 45
  • 5
  • `sns.barplot(data=df.reset_index().melt(id_vars='index'), x='index', y='value', hue='variable')` – JohanC Jan 17 '23 at 00:01

0 Answers0