Reputation: 99
df_new.plot(
kind = 'barh',
x = 'Measure',
stacked = True,
title = 'Stacked Bar Graph',
mark_right = True)
This gives me a key error on Measure - can't figure out why?
Upvotes: 0
Views: 31
Reputation: 37747
You need to tranpose your dataframe with pandas.DataFrame.T
to get one horizontal stacked bar:
Try this:
(
df_new
.T
.plot(kind = 'barh',
stacked = True,
title = 'Stacked Bar Graph',
mark_right = True)
)
Upvotes: 1