pip3 install matplotlib
from matplotlib import pyplot as plt
import matplotlib
- df.index=['a','b']
- df.plot(kind='bar',stacked=True,figsize=(8,8)
## male_survived
0 468
1 109
## female__survived
1 233
0 81
df=pd.DataFrame([male_survived,female__survived])
df.index=['male','female']
df.plot(kind='bar',stacked=True,figsize=(8,8))