utils.py 文件源码

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

项目:flexCE 作者: bretthandrews 项目源码 文件源码
def joint_overplot(x, y, df, fig, color='r', marg_kws=None):
    """Overplot additional data on existing JointGrid instance.

    Args:
        x (str):
        y (str):
        df (DataFrame):
        fig: seaborn JointGrid instance.
        color (str): Color.
        marg_kws (dict): Keyword arguments to pass to plot_marginals().

    Returns:
        fig: seaborn JointGrid instance.
    """
    if marg_kws is None:
        marg_kws = dict(norm_hist=True,
                        hist_kws=dict(weights=df.Survivors.values))
    fig.x = df[x]
    fig.y = df[y]
    fig.plot_joint(plt.scatter, c=color)
    fig.plot_marginals(sns.distplot, color=color, kde=False, axlabel=False,
                       **marg_kws)
    return fig
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号