zoukankan      html  css  js  c++  java
  • Python socket编程之六:多窗口的应用

    import struct
    import sqlalchemy
    import pandas
    import matplotlib.pyplot as Plot
    from matplotlib.finance import candlestick_ohlc as Drawk
    
    Engine = sqlalchemy.create_engine('mssql+pyodbc://sa:123456@XiTongDSN')
    Dataframe = pandas.read_sql('sh', Engine)
    
    I = list(Dataframe['date'].index)
    O = Dataframe['open']
    H = Dataframe['high']
    L = Dataframe['low']
    C = Dataframe['close']
    V = Dataframe['volume']
    Quotes = []
    for i in range(0, len(I)):
        Quotes.append((I[i], O[i], H[i], L[i], C[i], V[i]))
        
    figure = Plot.figure('Made by DengChaohai')
    
    f1 = figure.add_subplot(3, 4, (1, 7), title = 'Index of Shanghai')
    Drawk(f1, Quotes, colorup='g', colordown='r')
    Plot.grid(True)
    Plot.axis('tight')
    
    f2 = figure.add_subplot(1, 4, 4, title = 'Quotes')
    f2.text(0.2, 0.8, 'Bid2', color = 'g')
    f2.text(0.2, 0.6, 'Bid1', color = 'g')
    f2.text(0.2, 0.4, 'Ask1', color = 'r')
    f2.text(0.2, 0.2, 'Ask2', color = 'r')
    Plot.grid(True)
    
    f3 = figure.add_subplot(3, 4, (9, 11), title = 'Volume')
    f3.bar(I, V, color = 'c', edgecolor = 'c')
    Plot.grid(True)
    Plot.axis('tight')
    Plot.show()

    made_by_dengchaohai

  • 相关阅读:
    Bullet 学习笔记之 btPersistentManifold 及 btManifoldPoint
    Bullet 学习笔记之 btCollisionWorld::performDiscreteCollisionDetection
    Bullet 学习笔记之 btCollisionWorld
    hdu 6617
    codeforces 1247 E
    GYM 101174 A
    GYM 100714 G
    codeforces 1239 C
    牛客挑战赛33D
    codeforces 1238 E
  • 原文地址:https://www.cnblogs.com/blog-3123958139/p/5554179.html
Copyright © 2011-2022 走看看