Hi Noel,
My guess is that your density field spans several orders of magnitude in value, and that the transfer function is being set up in linear space, causing all sorts of havoc. I think you added the following before the tf = ColorTransferFuctiont((mi,ma)) call:
mi, ma = np.log10(mi), np.log10(ma)
pf.h
pf.field_info['density'].take_log=True
and use tf = ColorTransferFuctiont((mi-1,ma+1))
then use:
tf.add_layers(4, colormap="hsv", col_bounds=[mi,ma])
This will pad the TF with a bit extra space on the lower/upper bounds. When you add the layers, the col_bounds keyword will restrict the gaussians of emission to be within the range mi to ma.
Please let us know whether or not that works.
Best,
Sam