分时图设计

# -*- coding: utf-8 -*-
# %%
import tushare
import matplotlib.pyplot as plot
import time
# %%
count = 0
while count < 5:
    # %%
    rtquotes = tushare.get_realtime_quotes('002237')
    # %%
    name = rtquotes['name']
    code = rtquotes['code']
    # %%
    open = rtquotes['open']
    pre_close = rtquotes['pre_close']
    # %%
    bid = rtquotes['bid']
    ask = rtquotes['ask']
    # %%
    volume = rtquotes['volume']
    # %% bid
    b1_v = rtquotes['b1_v']
    b1_p = rtquotes['b1_p']
    b2_v = rtquotes['b2_v']
    b2_p = rtquotes['b2_p']
    b3_v = rtquotes['b3_v']
    b3_p = rtquotes['b3_p']
    b4_v = rtquotes['b4_v']
    b4_p = rtquotes['b4_p']
    b5_v = rtquotes['b5_v']
    b5_p = rtquotes['b5_p']
    # %% ask
    a1_v = rtquotes['a1_v']
    a1_p = rtquotes['a1_p']
    a2_v = rtquotes['a2_v']
    a2_p = rtquotes['a2_p']
    a3_v = rtquotes['a3_v']
    a3_p = rtquotes['a3_p']
    a4_v = rtquotes['a4_v']
    a4_p = rtquotes['a4_p']
    a5_v = rtquotes['a5_v']
    a5_p = rtquotes['a5_p']
    # %%
    date = rtquotes['date']
    time = rtquotes['time']
    # %%
    figure = plot.figure(count)
    # %%
    sp1 = plot.subplot(221)
    # %%
    sp2 = plot.subplot(222)
    # %%
    sp3 = plot.subplot(223)
    # %%
    sp4 = plot.subplot(224)
    # %%
    plot.hold(True)
    count += 1
posted @ 2016-05-28 01:45  佩雷尔曼的信徒  阅读(226)  评论(0编辑  收藏  举报