# -*- coding:utf-8 -*-
import numpy as np
from matplotlib import pyplot as plt
import xlrd
import xlwty
filename = '统计当月流量剩余占比的平均值.xlsx'
book_wind = xlrd.open_workbook(filename=filename)
wind_sheet1 = book_wind.sheets()[0]
# 读取第1行标题
title = wind_sheet1.row_values(0)
# 读取第一、三列标题以下的数据 col_values(colx,start_row=0,end_row=none)
x = wind_sheet1.col_values(0,1)
y = wind_sheet1.col_values(2,1)
print(x)
print(y)
# 绘制曲线图
plt.plot(x, y, 'r-.', label='mean')
plt.title('leftDataProp_mean',fontsize=16)
plt.legend() # 设置图例位置
plt.tight_layout()
plt.savefig('mean.jpg') # 保存图片
plt.show()