MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _init

Method _init

lib/matplotlib/colors.py:1164–1178  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1162 self._gamma = gamma
1163
1164 def _init(self):
1165 # Assemble the LUT first in a local variable in case of parallel threads
1166 lut = np.ones((self.N + 3, 4), float)
1167 lut[:-3, 0] = _create_lookup_table(
1168 self.N, self._segmentdata['red'], self._gamma)
1169 lut[:-3, 1] = _create_lookup_table(
1170 self.N, self._segmentdata['green'], self._gamma)
1171 lut[:-3, 2] = _create_lookup_table(
1172 self.N, self._segmentdata['blue'], self._gamma)
1173 if 'alpha' in self._segmentdata:
1174 lut[:-3, 3] = _create_lookup_table(
1175 self.N, self._segmentdata['alpha'], 1)
1176 self._lut = lut
1177 self._isinit = True
1178 self._update_lut_extremes()
1179
1180 def set_gamma(self, gamma):
1181 """Set a new gamma value and regenerate colormap."""

Callers 1

set_gammaMethod · 0.95

Calls 2

_create_lookup_tableFunction · 0.85
_update_lut_extremesMethod · 0.80

Tested by

no test coverage detected