transfer_functions.py 文件源码

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

项目:yt 作者: yt-project 项目源码 文件源码
def plot(self, filename):
        r"""Save an image file of the transfer function.

        This function loads up matplotlib, plots the transfer function and saves.

        Parameters
        ----------
        filename : string
            The file to save out the plot as.

        Examples
        --------

        >>> tf = TransferFunction( (-10.0, -5.0) )
        >>> tf.add_gaussian(-9.0, 0.01, 1.0)
        >>> tf.plot("sample.png")
        """
        import matplotlib
        matplotlib.use("Agg")
        import pylab
        pylab.clf()
        pylab.plot(self.x, self.y, 'xk-')
        pylab.xlim(*self.x_bounds)
        pylab.ylim(0.0, 1.0)
        pylab.savefig(filename)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号