cross_plotter.py 文件源码

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

项目:GRIPy 作者: giruenf 项目源码 文件源码
def create_x_pdf(self, where=None, color=None):
        if where is None:
            where = self.good
        if color is None:
            color = '#bbbbbb'

        xmin, xmax = self.xlim
        ymin, ymax = self.ylim

        x = np.linspace(xmin, xmax, 100)

        x_kde = stats.gaussian_kde(self.x[where])
        x_pdf = x_kde(x)
        x_pdf_n = x_pdf/np.nanmax(x_pdf)*(ymax - ymin)*self._FAC + ymin
        """
        x_pdf = self.crossplot_ax.fill_between(x, x_pdf_n, ymin,
                                               color=color, lw=0,
                                               alpha=alpha, zorder=-1)
        """
        x_pdf, = self.crossplot_ax.plot(x, x_pdf_n, color=color[:3],
                                        alpha=color[-1], zorder=-1)
        #"""
        self.x_pdfs.append(x_pdf)

        self.crossplot_ax.set_xlim(*self.xlim)
        self.crossplot_ax.set_ylim(*self.ylim)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号