Skip to content

Commit ccaf3de

Browse files
committed
Fix TypeError: AA Mask data type must be 12 when enabling Z-axis log scale tool with AA interpolation
FIx #40
1 parent de73b00 commit ccaf3de

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plotpy/items/image/image_items.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from qtpy import QtCore as QC
1212

1313
from plotpy import io
14+
from plotpy._scaler import INTERP_AA
1415
from plotpy.config import _
1516
from plotpy.constants import LUTAlpha
1617
from plotpy.coords import canvas_to_axes, pixelround
@@ -241,9 +242,13 @@ def set_zaxis_log_state(self, state):
241242
if self._log_data is None:
242243
self._log_data = np.array(np.log10(self.data.clip(1)), dtype=np.float64)
243244
self.set_lut_range(get_nan_range(self._log_data))
245+
dtype = self._log_data.dtype
244246
else:
245247
self._log_data = None
246248
self.set_lut_range(self._lin_lut_range)
249+
dtype = self.data.dtype
250+
if self.interpolate[0] == INTERP_AA:
251+
self.interpolate = (INTERP_AA, self.interpolate[1].astype(dtype))
247252
plot.update_colormap_axis(self)
248253

249254
# ---- BaseImageItem API ---------------------------------------------------

0 commit comments

Comments
 (0)