Beispiel #1
0
 def cmap_changed(self, name):
     self.colorbar.mappable.set_cmap(name)
     if mpl_version_info() >= (3, 1):
         self.colorbar.update_normal(self.colorbar.mappable)
     else:
         self.colorbar.set_cmap(name)
     self.redraw()
Beispiel #2
0
    def __init__(self, _axis, **kwargs):
        """
        Any keyword arguments passed to ``set_xscale`` and
        ``set_yscale`` will be passed along to the scale's
        constructor.

        gamma: The power used to scale the data.
        """
        if mpl_version_info() > (3,):
            super(PowerScale, self).__init__(_axis)
        else:
            super(PowerScale, self).__init__()
        gamma = kwargs.pop("gamma", None)
        if gamma is None:
            raise ValueError("power scale must specify gamma value")
        self._gamma = float(gamma)