I have a 3D array of scalars representing different physical elements of a mesh, i.e. solid, liquid, or a different material of solid. I'd like to set scalars equal to 1 to be [0,1,1], scalars equal to 2 to [0,1,0], and scalars equal to 3 equal to [1, .67, 1]. I'm not sure how to define a custom colormap based on a scalar field, i.e. each scalar value in the array being associated with a specific color.
import mayavi.mlab as ml
def visualize(self):
if len(self.geo) == 0:
self.create_geo()
ml.contour3d(self.geo, transparent = True)
ml.gcf().scene.parallel_projection = True
ml.show()