lets-plot
lets-plot copied to clipboard
`geom_imshow`: unclear error message when mixing transparencies
Example:
img_array = np.array([
[[0, 0, 255, 255], [0, 0, 255, 127]],
[[255, 0, 0, 127], [255, 0, 0, 255]]
])
ggplot() + geom_imshow(img_array, alpha=.5)
The code throws:
UFuncTypeError: Cannot cast ufunc 'multiply' output from dtype('float64') to dtype('int32') with casting rule 'same_kind'
But the real problem is that we are using the alpha channel in the image and the alpha param of the geom_imshow() function at the same time, and Lets-Plot cannot handle this case.