tab_covariance.py 文件源码

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

项目:kite 作者: pyrocko 项目源码 文件源码
def __init__(self, model):
            from pyqtgraph.graphicsItems.GradientEditorItem import Gradients
            self._component = 'weight'

            KitePlot.__init__(self, model)
            self.model = model

            gradient = Gradients['thermal']

            self.cmap = pg.ColorMap(
                pos=[c[0] for c in gradient['ticks']],
                color=[c[1] for c in gradient['ticks']],
                mode=gradient['mode'])
            self.image.setLookupTable(self.cmap.getLookupTable())

            self.setLabels(
                bottom={'Leaf #', ''},
                left={'Leaf #', ''})

            self.setAspectLocked(True)
            self.setMouseEnabled(x=False, y=False)

            self.hint = {
                'leaf1': 0,
                'leaf2': 0,
                'weight': num.nan}

            self.hint_text.template =\
                '<span style="font-family: monospace; color: #fff;'\
                'background-color: #000;">'\
                'Leaf #1: {leaf1:d} | Leaf #2: {leaf2:d} | '\
                'Weight {weight:e}</span>'

            self.update()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号