%matplotlib inline
%time from hikyuu.interactive import *
Wall time: 0 ns
使用 create_figure 函数快速创建查看证券K线信息的常见组合窗口
help(create_figure)
Help on function create_figure in module hikyuu.draw.drawplot: create_figure(n=1, figsize=None) 生成含有指定坐标轴数量的窗口,最大只支持4个坐标轴。 :param int n: 坐标轴数量 :param figsize: (宽, 高) :return: (ax1, ax2, ...) 根据指定的坐标轴数量而定,超出[1,4]个坐标轴时,返回None
#不同坐标轴数量,其显示窗口布局
create_figure(figsize=(6,4))
create_figure(2, figsize=(6,4))
create_figure(3, figsize=(6,4))
create_figure(4, figsize=(6,4))
(<matplotlib.axes._axes.Axes at 0x23edca6c040>, <matplotlib.axes._axes.Axes at 0x23ed21c6190>, <matplotlib.axes._axes.Axes at 0x23eef4afd90>, <matplotlib.axes._axes.Axes at 0x23ecae68e20>)
s = sm['sh000001']
k = s.get_kdata(Query(-200))
#创建两个显示坐标轴的窗口
ax1,ax2 = create_figure(2)
#在第一个坐标轴中绘制K线和EMA
k.plot(axes=ax1)
ma = EMA(CLOSE(k))
ma.plot(axes=ax1, legend_on=True)
#在第二个坐标轴中绘制艾尔德力度指标
v = VIGOR(k)
v.plot(axes=ax2, legend_on=True)
ax1,ax2, ax3 = create_figure(3)
k.plot(axes=ax1)
ma.plot(axes=ax1, legend_on=True)
ax_draw_macd(axes=ax2, kdata=k)
ax_draw_macd2(axes=ax3, ref=ma, kdata=k)
el.draw(s)
vl.draw(s)
vl.draw2(s)
2021-02-12 17:01:41,175 [WARNING] No handles with labels found to put in legend. [matplotlib.legend::_parse_legend_args]
kf.draw(s)
kf.draw2(blocka)