# Examples from pyvista.plotting.volume_property.VolumeProperty.apply_lookup_table
# ================================================================================

# Plot perlin noise volumetrically using a custom lookup table.
import pyvista as pv
noise = pv.perlin_noise(1, (1, 3, 5), (0, 0, 0))
grid = pv.sample_function(
    noise, bounds=[0, 3.0, -0, 1.0, 0, 1.0], dim=(40, 40, 40)
)
pl = pv.Plotter()
actor = pl.add_volume(grid, show_scalar_bar=False)
lut = actor.mapper.lookup_table
lut.cmap = 'bwr'
lut.apply_opacity([1.0, 0.0, 0.0, 0.3, 0.0, 0.0, 0.0, 0.3])
pl.show()

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code

