Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 558 Bytes

File metadata and controls

42 lines (28 loc) · 558 Bytes

Matplotlib 資料視覺化

安裝與使用

pip3 install matplotlib
from matplotlib import pyplot as plt
import matplotlib

Plot 圖

  • 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))

plot