Seaborn pairwise matrix of hexbin jointplots

后端 未结 1 761
陌清茗
陌清茗 2021-01-19 16:21

I am trying to produce a matrix of pairwise plots comparing distributions (something like this). Since I have many points I want to use a hexbin plot to reduce time and plot

相关标签:
1条回答
  • 2021-01-19 16:34

    See the last example in the tutorial on using custom functions with FacetGrid, which I'll reproduce here:

    def hexbin(x, y, color, **kwargs):
        cmap = sns.light_palette(color, as_cmap=True)
        plt.hexbin(x, y, gridsize=15, cmap=cmap, **kwargs)
    
    g = sns.FacetGrid(tips, hue="time", col="time", size=4)
    g.map(hexbin, "total_bill", "tip", extent=[0, 50, 0, 10])
    

    enter image description here

    0 讨论(0)
提交回复
热议问题