visualizer.py 文件源码

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

项目:coquery 作者: gkunter 项目源码 文件源码
def get_palette(self):
        """
        Return a palette that is suitable for the data.
        """
        # choose the "Paired" palette if the number of grouping factor
        # levels is even and below 13, or the "Set3" palette otherwise:
        if len(self._levels) == 0:
            if len(self._groupby) == 1:
                return sns.color_palette("Paired")[0]
            else:
                palette_name = "Paired"
        elif len(self._levels[-1]) in (2, 4, 6):
            palette_name = "Paired"
        else:
            # use 'Set3', a quantitative palette, if there are two grouping
            # factors, or a palette diverging from Red to Purple otherwise:
            palette_name = "Paired" if len(self._groupby) == 2 else "RdPu"
        return sns.color_palette(palette_name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号