# -*- coding: utf-8 -*-
#汉字处理
import matplotlib.pyplot as plt
import numpy as np
from numpy.random import randn
import pandas as pd
#import DataFrame
from matplotlib.font_manager import FontProperties
font = FontProperties(fname=r"c:\windows\fonts\simsun.ttc", size=14)
#字体设置
#s=pd.Series(np.random.rand(10).cumsum(),index=np.arange(0,100,10))
#s.plot()
df=pd.DataFrame(np.random.rand(10,4).cumsum(0),
columns=['A','B','C','D'],
index=np.arange(0,100,10))
df.plot(grid=True,xlim=[0,120],ylim=[0,10],kind='line')
plt.title(u"随机(4)",fontproperties=font)
plt.savefig('fig4.jpg')
kind代表图表的类型:
line:折线图
bar:柱状图
barh:横向柱状图
grid代表网格线是否显示