bokeh.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:physt 作者: janpipek 项目源码 文件源码
def _line_scatter(h1, kind, show=True, **kwargs):
    """Line or scatter plot.

    The common functionality (the plots differ only in method called).
    """
    density = kwargs.pop("density", False)
    cumulative = kwargs.pop("cumulative", False)
    size = kwargs.pop("size", 8)

    p = kwargs.pop("figure", _create_figure(h1))

    data = get_data(h1, cumulative=cumulative, density=density)

    plot_data = {
        "x" : h1.bin_centers,
        "y" : data
    }
    if kind == "line":
        p.line(plot_data['x'], plot_data['y'])
    elif kind == "scatter":
        p.scatter(plot_data['x'], plot_data['y'], size=size)
    if show:
        bokeh_show(p)
    return p
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号