2

I found this plot and i would like to rotate it. My goal is to have the bars in the vertical axis. SIMILAR to the 2nd one plot.

plot = pd.DataFrame(data.groupby(['LIFESTAGE', 'PREMIUM_CUSTOMER']).TOT_SALES.sum()) 

plot.unstack().plot(kind = 'bar', stacked = True, figsize = (12, 7), title = 'Total Sales by Customer Segment')

enter image description here

enter image description here

1
  • 1
    Maybe kind='barh'? Commented Jun 4, 2021 at 0:45

1 Answer 1

5

You can use kind = 'barh'

Please refer to : https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.plot.html

sklearn documentation snapshot

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.