#!/usr/bin/env python
# -*- coding:utf-8 -*-
# __author__ = "blzhu"
"""
python study
Date:2017
"""
# coding=utf-8
#######################################################
# filename:xlrd_draw.py
# author:
# date:xxxx-xx-xx
# function:读excel文件中的数据
#######################################################
import numpy as np
import matplotlib.pyplot as plt
import xlrd # 打开一个workbook
workbook = xlrd.open_workbook(r'E:\python\pycharmwork\test\matplotlibzbl\Barometer.xlsx') # 抓取所有sheet页的名称
worksheets = workbook.sheet_names()
print('worksheets is %s' % worksheets) # 定位到mySheet
mySheet = workbook.sheet_by_name(u'Pressure') # get datas
pressure = mySheet.col_values(0)
print(pressure)
time = mySheet.col(1)
print('time1',time)
time = [x.value for x in time]
print('time2',time) # drop the 1st line of the data, which is the name of the data.
pressure.pop(0)
time.pop(0) # declare a figure object to plot
fig = plt.figure(1) # plot pressure
plt.plot(time,pressure) plt.title('Barometer')
plt.ylabel('Pa')
plt.xticks(range(len(time)),time)
plt.show()

参考:http://blog.csdn.net/huhuang/article/details/53809891

学习python好去处:http://i.youku.com/pythontutorial

python3.4读取excel数据绘图的更多相关文章

  1. java的poi技术读取Excel数据到MySQL

    这篇blog是介绍java中的poi技术读取Excel数据,然后保存到MySQL数据中. 你也可以在 : java的poi技术读取和导入Excel了解到写入Excel的方法信息 使用JXL技术可以在 ...

  2. .NET读取Excel数据,提示错误:未在本地计算机上注册“Microsoft.ACE.OLEDB.12.0”提供程序

    解决.NET读取Excel数据时,提示错误:未在本地计算机上注册“Microsoft.ACE.OLEDB.12.0”提供程序的操作: 1. 检查本机是否安装Office Access,如果未安装去去h ...

  3. oledbdataadapter 读取excel数据时,有的单元格内容不能读出

    表现:excel中某列中,有的单元格左上角有绿色箭头标志,有的没有,c#编写读取程序,但是只能读取出带绿色箭头的单元格中的内容,其余不带的读取不到内容 原因:excel中单元格因为是文本格式而存储了数 ...

  4. Openxml入门---Openxm读取Excel数据

    Openxml读取Excel数据: 有些问题,如果当Cell 里面是 日期和浮点型的话,对应的Cell.DataType==Null,对应的时间会转换为一个浮点型,对于这块可以通过DateTime.F ...

  5. C# 读取EXCEL数据

       /// <summary> /// 读取EXCEL数据 /// </summary> /// <param name="Path">< ...

  6. JAVA反射机制示例,读取excel数据映射到JAVA对象中

    import java.beans.PropertyDescriptor; import java.io.File; import java.io.FileInputStream; import ja ...

  7. Python读取Excel数据并根据列名取值

    一直想将自己接触到的东西梳理一遍,可就是迈不出第一步,希望从这篇总结开始不要再做行动的矮人了. 最近测试过程中需要用到python读取excel用例数据,于是去了解和学习了下xlrd库,这里只记录使用 ...

  8. jxl读写excel, poi读写excel,word, 读取Excel数据到MySQL

    这篇blog是介绍: 1. java中的poi技术读取Excel数据,然后保存到MySQL数据中. 2. jxl读写excel 你也可以在 : java的poi技术读取和导入Excel了解到写入Exc ...

  9. Delphi中使用python脚本读取Excel数据

    Delphi中使用python脚本读取Excel数据2007-10-18 17:28:22标签:Delphi Excel python原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 . ...

随机推荐

  1. 【Linux 进程】fork父子进程间共享数据分析

    之前我们通过fork()函数,得知了父子进程之间的存在着代码的拷贝,且父子进程都相互独立执行,那么父子进程是否共享同一段数据,即是否存在着数据共享.接下来我们就来分析分析父子进程是否存在着数据共享. ...

  2. django的中间件:process_request|process_response|process_view|process_exception

    MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware. ...

  3. Linux下新建服务

    1 首先在/etc/rc.d/init.d/下添加脚本 asr_cron #!/bin/bash # $Id: rc.redhat.asterisk -- ::43Z tilghman $ # # a ...

  4. Redhat ssh服务登录慢

    redhat在安装以后每次通过ssh服务登录,要等待几秒才能进入. 只要在sshd_config修改一下以下值就好 vim /etc/ssh/sshd_config UseDNS no service ...

  5. storage封装

    storage.js /* storage 主要放项目中的storage相关操作:存取等 */ var storage = { /** 对本地数据进行操作的相关方法,如localStorage,ses ...

  6. Navicat premiu的导入和导出

    对于Navicat premiu(数据库管理工具)中对于数据库的导出和导入步骤如下: 1.选择要导出的数据库->转储SQL文件->选择结构和数据或结构->选择存放的路径,即可导出成功 ...

  7. js 横屏 竖屏 相关代码 与知识点

    <!DOCTYPE html> <html> <head> <title></title> </head> <body&g ...

  8. Windows删除服务方法

  9. Linux pip安装使用详解

    简介 pip是Python有它自己的包管理工具,与yum和apt-get相似. 安装步骤: 1.下载get-pip.py:https://bootstrap.pypa.io/get-pip.py 2. ...

  10. string+和stringbuffer的速度比较

    public class Main{ public static void main(String[] args){ /* 1 */ String string = "a" + & ...