Skip to content

Commit 1375f5d

Browse files
authored
Create mult_bar.py
使用pandas.DataFrame画了多个条形图
1 parent 2603a7e commit 1375f5d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

matplotlib/mult_bar.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#Author: Listen
2+
#!/usr/bin/env python3
3+
#-*- coding:utf-8 -*-
4+
5+
import pandas as pd
6+
import numpy as np
7+
import matplotlib.pyplot as plt
8+
9+
df= pd.DataFrame({'Height':[175,165,162,158,180],
10+
'Age':[23,30,27,21,35],
11+
'Scores':[80,100,70,85,65]},
12+
index=['Jack','Leo','James','Lily','David'])
13+
df.plot(kind='bar')
14+
plt.savefig('../savefig/mylt_bar.png')
15+
plt.show()
16+
17+
18+

0 commit comments

Comments
 (0)