matplotlib.pyplot

import tushare as ts

import pandas as pd

import numpy  as np

import matplotlib.pyplot as plt

import seaborn as sns

#绘制线图

plt.plot(数据,label='标签名字',color='r红,y黄,g,b,...',marker='点的形状',linewidth='线宽')

plt.xlim(最小值,最大值)#x轴的区间限制

plt.ylim(最小值,最大值)#y轴的区间限制

plt.xlabel('横坐标名称')

plt.ylabel('纵坐标名称')

plt.axhline(数值,linewidth=线宽,color='')#添加横线

plt.legend()#添加上标

plt.title('图标名称')#整张图标名称

plt.grid(True,axis='x或者y或者both')

#绘制直方图

plt.figure(figsize=(14,7))#设置画布大小

plt.hist(数据,bins=分组数,color='')

#绘制水平直方图

plt.hist(数据,orientation='horizontal',edgecolor='r')

#多图绘制

plt.figure(28,14)

plt.subplot(211)

plt.plot(数据,label='标签名字',color='r红,y黄,g,b,...',marker='点的形状',linewidth='线宽')

plt.subplot(212)

plt.hist(数据,bins=分组数,color='')

 

posted @ 2018-06-28 10:40  The_Chain  阅读(178)  评论(0编辑  收藏  举报