Skip to content

Commit e1779ac

Browse files
committed
fix: update log data when z-axis log scale is enabled
1 parent 53af760 commit e1779ac

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

plotpy/items/image/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,12 @@ def set_data(
360360
_min, _max = get_nan_range(data)
361361
self.set_lut_range((_min, _max))
362362

363+
if self.get_zaxis_log_state():
364+
self._log_data = np.array(
365+
np.log10(self.data.clip(1)), dtype=np.float64
366+
)
367+
self.set_lut_range(get_nan_range(self._log_data))
368+
363369
def get_data(
364370
self, x0: float, y0: float, x1: float | None = None, y1: float | None = None
365371
) -> float | tuple[np.ndarray, np.ndarray, np.ndarray]:

0 commit comments

Comments
 (0)