transfer_function_helper.py 文件源码

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

项目:yt 作者: yt-project 项目源码 文件源码
def setup_default(self):
        """Setup a default colormap

        Creates a ColorTransferFunction including 10 gaussian layers whose
        colors sample the 'spectral' colormap. Also attempts to scale the
        transfer function to produce a natural contrast ratio.

        """
        if LooseVersion(matplotlib.__version__) < LooseVersion('2.0.0'):
            colormap_name = 'spectral'
        else:
            colormap_name = 'nipy_spectral'
        self.tf.add_layers(10, colormap=colormap_name)
        factor = self.tf.funcs[-1].y.size / self.tf.funcs[-1].y.sum()
        self.tf.funcs[-1].y *= 2*factor
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号