コード例 #1
0
ファイル: histogram_client.py プロジェクト: antonl/glue
    def sync_all(self, force=False):

        if not self._sync_enabled:
            return

        if self.component is not None:

            if not (self.xlog, self.component) in self._xlim_cache or not self.component in self._xlog_cache:
                self._auto_limits()
                self._xlim_cache[(self.xlog, self.component)] = self.xmin, self.xmax
                self._xlog_cache[self.component] = self.xlog
            elif self.xlog is self._xlog_curr:
                self._xlim_cache[(self.xlog, self.component)] = self.xmin, self.xmax
            else:
                self._xlog_cache[self.component] = self.xlog
                self.xmin, self.xmax = self._xlim_cache[(self.xlog, self.component)]

            self._xlog_curr = self.xlog

        layers = set(a.layer for a in self._artists)
        for l in layers:
            self._sync_layer(l, force=force)

        self._update_axis_labels()

        if self.autoscale:
            lim = visible_limits(self._artists, 1)
            if lim is not None:
                lo = 1e-5 if self.ylog else 0
                hi = lim[1]
                # pad the top
                if self.ylog:
                    hi = lo * (hi / lo) ** 1.03
                else:
                    hi *= 1.03
                self._axes.set_ylim(lo, hi)

        yscl = 'log' if self.ylog else 'linear'
        self._axes.set_yscale(yscl)

        self._redraw()
コード例 #2
0
ファイル: scatter_client.py プロジェクト: antonl/glue
 def _visible_limits(self, axis):
     """Return the min-max visible data boundaries for given axis"""
     return visible_limits(self.artists, axis)