Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7170898
  • 博文数量: 3857
  • 博客积分: 6409
  • 博客等级: 准将
  • 技术积分: 15948
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-02 16:48
个人简介

迷彩 潜伏 隐蔽 伪装

文章分类

全部博文(3857)

文章存档

2017年(5)

2016年(63)

2015年(927)

2014年(677)

2013年(807)

2012年(1241)

2011年(67)

2010年(7)

2009年(36)

2008年(28)

分类:

2012-11-26 10:31:27


点击(此处)折叠或打开

  1. import matplotlib.pyplot as plt
  2. import numpy as np
  3. import xlrd
  4. import os
  5. from StringIO import StringIO


  6. if __name__ == '__main__':
  7.     data = xlrd.open_workbook('D:\\tt.xls')
  8.     
  9.     plt.figure(figsize=(8,4))
  10.     plt.xlabel(u'second')
  11.     plt.ylabel(u'xxx')
  12.    
  13.     
  14.     x_index=1
  15.     
  16.     data.sheet_names()
  17.     table = data.sheets()[0]
  18.     table = data.sheet_by_index(0)
  19.     table = data.sheet_by_name(u'Sheet1')
  20.     print("Good")
  21.     COLOR_INDEX=1
  22.     INDEX_NAME=''
  23.     
  24.     ## init data
  25.     
  26.     
  27.     nrows = table.nrows
  28.     ncols = table.ncols
  29.     print("nr=%d nc=%d \n"%(nrows,ncols))
  30.     
  31.     '''
  32.     for rownum in range(table.nrows):
  33.             value = table.cell(rownum,2).value
  34.             if rownum == 0:
  35.                 print("")
  36.             else:
  37.                 try:
  38.                     value_int = int(value)
  39.                     x.append(x_index)
  40.                     y.append(value_int)
  41.                    # line = ax.plot(x_index,value_int,label="xx ",color="red",linewidth=2)
  42.                     #plt.plot(x_index,value_int,label="xx ",color="red",linewidth=2)
  43.                     print("index=%d"%x_index)
  44.                     
  45.                     #plt.plot_date(x_index,value_int)
  46.                     x_index=x_index+1
  47.                 except:
  48.                     print("error")
  49.     plt.plot(x,y,label="xx ",color="red",linewidth=2)
  50.     '''
  51.     for colnum in range(table.ncols):
  52.         x=[]
  53.         y=[]
  54.         for rownum in range(table.nrows):
  55.             value = table.cell(rownum,colnum).value
  56.             #print("nr=%d nc=%d value=%d \n"%(rownum,colnum,value ))
  57.             #print(value)
  58.             #print("rownum=%d colnum=%d "%(rownum,colnum))
  59.             if rownum == 0:
  60.                 print("")
  61.             else:
  62.                 try:
  63.                     value_int = int(value)
  64.                     x.append(x_index)
  65.                     y.append(value_int)
  66.                     #plt.plot(x_index,value_int,label=" ",color="red",linewidth=2)
  67.                     #print("index=%d"%x_index)
  68.                     
  69.                     #plt.plot_date(x_index,value_int)
  70.                     x_index=x_index+1
  71.                 except:
  72.                     print("error")
  73.         if COLOR_INDEX == 1:
  74.             COLOR_INDEX = 0
  75.             plt.plot(x,y,color="red",linewidth=2)
  76.         else:
  77.             COLOR_INDEX =1
  78.             plt.plot(x,y,color="blue",linewidth=2)
  79.         print("==============================>")
  80.        
  81.     plt.title("RTT Test")
  82.     #plt.ylim(10,2000)
  83.     plt.legend()
  84.     plt.show()
  85.         
  86.    
  87.     pass

阅读(593) | 评论(0) | 转发(0) |
0

上一篇:关于/etc/hosts文件

下一篇:编译内核

给主人留下些什么吧!~~