matplotlib可视化柱状图
人员信息表person:http://download.csdn.net/download/lxb1022/9933828
#coding:utf-8
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
myfont = FontProperties(fname='/usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc')
fig=plt.figure()
ax1 = fig.add_subplot(221)
ax2 = fig.add_subplot(222)
ax3 = fig.add_subplot(223)
ax4 = fig.add_subplot(224)
df = pd.read_excel('/home/soft/person.xls')
#排名前5的省份人数
province = df.groupby('province').count()
provincenum= province.loc[:,['num']].sort_index(axis=0,by='num',ascending=False).head(5)
x=range(len(provincenum))
y=list(provincenum['num'])
slicegender = df.loc[:,['num','province','