内射老阿姨1区2区3区4区_久久精品人人做人人爽电影蜜月_久久国产精品亚洲77777_99精品又大又爽又粗少妇毛片

利用pythonnumpy+matplotlib繪制股票k線圖的方法-創(chuàng)新互聯(lián)

一、python numpy + matplotlib 畫股票k線圖

創(chuàng)新互聯(lián)主要從事網(wǎng)站設(shè)計制作、成都網(wǎng)站設(shè)計、網(wǎng)頁設(shè)計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)原州,10年網(wǎng)站建設(shè)經(jīng)驗,價格優(yōu)惠、服務(wù)專業(yè),歡迎來電咨詢建站服務(wù):13518219792
# -- coding: utf-8 --
import requests
import numpy as np  
from matplotlib import pyplot as plt  
from matplotlib import animation
 
fig = plt.figure(figsize=(8,6), dpi=72,facecolor="white")
axes = plt.subplot(111)
axes.set_title('Shangzheng')
axes.set_xlabel('time')
line, = axes.plot([], [], linewidth=1.5, linestyle='-')
alldata = []
 
def dapan(code):
	url = 'http://hq.sinajs.cn/?list='+code
	r = requests.get(url)
	data = r.content[21:-3].decode('gbk').encode('utf8').split(',')
	alldata.append(data[3])
	axes.set_ylim(float(data[5]), float(data[4]))
	return alldata
 
def init():
	line.set_data([], [])
	return line
 
def animate(i): 
 	axes.set_xlim(0, i+10)
 	x = range(i+1)
 	y = dapan('sh000001')
 	line.set_data(x, y)
 	return line
 
anim=animation.FuncAnimation(fig, animate, init_func=init, frames=10000, interval=5000)
 
plt.show()

分享題目:利用pythonnumpy+matplotlib繪制股票k線圖的方法-創(chuàng)新互聯(lián)
分享地址:http://www.rwnh.cn/article26/dhhscg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站導(dǎo)航關(guān)鍵詞優(yōu)化、服務(wù)器托管、網(wǎng)站建設(shè)、外貿(mào)建站、網(wǎng)站設(shè)計

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

商城網(wǎng)站建設(shè)
彭泽县| 朔州市| 临高县| 衢州市| 清原| 福州市| 德格县| 漳平市| 荥阳市| 和顺县| 革吉县| 武鸣县| 镇远县| 邹平县| 临洮县| 南靖县| 厦门市| 普定县| 静安区| 板桥市| 沁阳市| 临沂市| 察隅县| 博客| 辽阳县| 澜沧| 察雅县| 阜新| 罗江县| 杭锦后旗| 同德县| 彝良县| 桦甸市| 临夏市| 祁阳县| 水富县| 元阳县| 连城县| 佳木斯市| 密山市| 天祝|