visualizer.py 文件源码

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

项目:coquery 作者: gkunter 项目源码 文件源码
def setup_figure(self):
        """
        Prepare the matplotlib figure for plotting.

        This method sets the default font, and the overall apearance of the
        figure.
        """

        if options.cfg.xkcd:
            fonts = QtGui.QFontDatabase().families()
            for x in ["Humor Sans", "DigitalStrip", "Comic Sans MS"]:
                if x in fonts:
                    self.options["figure_font"] = QtGui.QFont(x, pointSize=self.options["figure_font"].pointSize())
                    break
            else:
                for x in ["comic", "cartoon"]:
                    for y in fonts:
                        if x.lower() in y.lower():
                            self.options["figure_font"] = QtGui.QFont(x, pointSize=self.options["figure_font"].pointSize())
                            break
            plt.xkcd()

        with sns.plotting_context("paper"):
            self.g = sns.FacetGrid(self._table,
                                   col=self._col_factor,
                                   col_wrap=self._col_wrap,
                                   row=self._row_factor,
                                   sharex=True,
                                   sharey=True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号