【问题标题】:How to change seaborn jointplot linewidth?如何更改 seaborn 联合图线宽?
【发布时间】:2020-04-20 07:08:49
【问题描述】:

hexs = sns.jointplot(a,b,marker = '.', kind = "reg", height=1.476, scatter_kws={'s':2, 'linewidth':0.1},joint_kws={'line_kws':{'linewidth':'0.5'}})

我可以更改散点大小和回归线宽度。 但是如何改变曲线宽度?(黑色箭头所指的曲线)

【问题讨论】:

    标签: width line settings seaborn curve


    【解决方案1】:

    顾名思义,jointplot 是一些其他地块的组合。

    可以通过marginal_kws= 控制边缘子图的视觉方面。 在这种情况下,使用distplot 绘制边缘图。反过来,在distplot 中,使用kdeplot 绘制核密度近似值。这个kdeplot的参数是通过marginal_kws里面的kde_kws来控制的。

    from matplotlib import pyplot as plt
    import seaborn as sns
    
    tips = sns.load_dataset("tips")
    g = sns.jointplot("total_bill", "tip", data=tips, marker='.', kind="reg", height=1.476,
                      scatter_kws={'s': 2, 'linewidth': 0.1},
                      joint_kws={'line_kws': {'linewidth': 0.5}},
                      marginal_kws={'color': 'g', 'kde_kws': {'linewidth': 0.5}})
    plt.show()
    

    【讨论】:

    • 这个答案有帮助吗?
    猜你喜欢
    • 2015-10-12
    • 1970-01-01
    • 2016-12-26
    • 1970-01-01
    • 2016-07-24
    • 1970-01-01
    • 2020-08-28
    • 2021-02-17
    相关资源
    最近更新 更多