In [ ]:
import yt
import numpy as np
from yt.testing import fake_vr_orientation_test_ds

ds = fake_vr_orientation_test_ds()

In [ ]:
# now we do volume rendering
sc = yt.create_scene(ds, field='density')
sc.render()
sc.show(sigma_clip=6.0)

In [ ]:
# now we do volume rendering
sc = yt.create_scene(ds, field='density')
# Change transfer function
tf = yt.ColorTransferFunction((np.log10(0.1), np.log10(1.)))
tf.sample_colormap(np.log10(0.9), 0.01, colormap="spectral")
tf.sample_colormap(np.log10(0.8), 0.01, colormap="spectral")
tf.sample_colormap(np.log10(0.6), 0.01, colormap="spectral")
tf.sample_colormap(np.log10(0.2), 0.01, colormap="spectral")
render_source = sc.get_source(0)
render_source.transfer_function = tf

In [ ]:
sc.render()
sc.show(sigma_clip=6.0)