browser.py 文件源码

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

项目:gcMapExplorer 作者: rjdkmr 项目源码 文件源码
def ylimit(self, value):
        """Upper and lower limit of current plot.
        Permanent limits are stored in yScaleSteps, which can be changed by user using range box.

        This is the only function through which plots can be updated.
        """
        if value[0] == value[1]:
            return

        if not self.hiCmapAxis.doNotPlot:
            self._ylimit = [ value[0], value[1] ]

            # Setting yticks based on ylimits, only change yticks when y-limits are changed
            ydiff = value[0] - value[1]
            yticks = np.linspace(self.ylimit[0], self.ylimit[1], 100)

            # Set tick label according to precision
            self.yticksDecimals = gmlib.util.locate_significant_digit_after_decimal(ydiff)
            if self.yticksDecimals > 3:
                self.yticksFormatStyle = 'sci'
                self.yticks = np.around(yticks, decimals=self.yticksDecimals+1)
            else:
                self.yticks = np.around(yticks, decimals=self.yticksDecimals+1)

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


问题


面经


文章

微信
公众号

扫码关注公众号