python

# -*- coding: utf-8 -*-
"""
Created on Mon Nov 30 13:24:00 2015

@author: jx_luo
"""

from pandas import DataFrame, Series

import pandas as pd
import numpy as np

import matplotlib.pyplot as plt
import matplotlib.font_manager as font_manager

path=r'D:Usersjx_luoDocumentswait.txt'
frame=pd.read_csv(path,header=False,sep='	')



f=pd.pivot_table(frame, index='createdate',values='wait',columns='paycategory' ,aggfunc=np.sum)


#ax = f.plot(subplots=True,figsize=(12,20),grid=False, title='wait ')

ax=f.plot()

legend = ax.legend()
font = font_manager.FontProperties(fname=r"C:WindowsFontssimhei.ttf")

for text in legend.texts:
    text.set_font_properties(font)

plt.show()
原文地址:https://www.cnblogs.com/melodyluo/p/5017117.html