python学习---第七天

在下这厢有礼了

Python实现从Excel读取数据绘制成精美图像

学习介绍

Python从excel读取数据

matplotlib绘制成二维图像


实现环境

python2.7

Xfce终端


代码获取

wget  http://labfile.oss.aliyuncs.com/courses/791/finally.py

wget  http://labfile.oss.aliyuncs.com/courses/791/finally.py

wget  http://labfile.oss.aliyuncs.com/courses/791/finally.py

wget  http://labfile.oss.aliyuncs.com/courses/791/finally.py


相关下载

sudo apt-get update

sudo apt-get install python-dev

sudo pip install numpy

sudo apt-get install Python-matplotlib

sudo pip install xlrd

sudo apt-get install Python-sip

sudo apt-get install libqt4-dev

sudo apt-get install python-qt4 python-qt4-dev pyqt4-dev-tools qt4-dev-tools


安装matplotlib完成后,测试

正弦函数示例代码

import numpy as np

import matplotlib.pyplot as plt


x = np.linspace(0,10,500)

dashes = [10,5,100,5]#10 points on,5 off, 100 on,5 off


fig, ax = plt.subplots()

line1, = ax.plot(x,np.sin(x), '--',linewidth = 2,

labbel = 'Dashes set retroactively')

line1.set_dashes(dashes)


line2, = ax.plot(x, -1 * np.sin(x),dashes = [30,5,10,5],

label = 'Dashes set proactively')


ax.legend(loc='lower right')

plt.show()


如果执行无误,应该是如下图形


以上网上学习看到,写的,后期我会一步步验证

明天接着写

第七天过去了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值