enthought / enthought/mayavi

imshow ignores transparency and LUT changes of alpha values

Open
#611 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
316
Avg merge
7h 44m
Merged PRs (30d)
5

Description

I failed to make scalar-field-based transparency work with `imshow()`. I first tried setting `transparent=True` but this had no effect when done programmatically. It is only taken into account when I use the GUI to change to the "black-white" colormap (and only this one). I tried also changing the lookup table in the `module_manager`. No effect. If I directly use "black-white" colormap, I still need to go to the GUI, change the colormap, and go back to "black-white" for the transparency to work.

Here's a code to replicate:

```
data = np.repeat(np.linspace(0,1,512)[:,np.newaxis], 512, axis=1 )
mlab.figure(bgcolor=(1,1,1))
# Use transparency
im = mlab.imshow(data, colormap='cool', transparent=True)

# Tried changing the lookup table below. No effect.
cmap = im.module_manager.scalar_lut_manager.lut.table.to_array()
cmap[:, -1] = np.linspace(0, 255, 256)
im.module_manager.scalar_lut_manager.lut.table = cmap
mlab.draw()
mlab.view(0, 0)
mlab.show()
```

This is under macOS Sierra 10.12.6.
Python 3.5 with qt 4.8.7.
Graphics: Radeon Pro 460 & Intel HD Graphics 530
Mayavi 4.5

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.