Intermittent error in use of mayavi
I am not sure if this is a vtk issue or elsewhere but it only happens with vtk>6.3 This code:
from mayavi import mlab
import numpy as np
my=np.array([[1,2,3],[4,5,6],[7,8,9]])
plotme=np.log(my)
plotme[np.isinf(plotme)]=0
mlab.figure(bgcolor=(0,0,0))
src=mlab.pipeline.scalar_field(plotme)
mlab.pipeline.volume(src)
mlab.pipeline.image_plane_widget(src,plane_orientation='y_axes')
mlab.xlabel('E')
mlab.ylabel('mu')
mlab.zlabel('P')
mlab.outline()
mlab.show()
Only sometimes works. Sometimes errors like: traits.trait_errors.TraitError: The 'vector_component' trait of a SmartVolumeMapper instance must be 0 <= a long integer <= 3, but a value of 1750425008 <class 'int'> was specified. Change the version of vtk to 6.3 and it works every time. Same behaviour with python 2 and 3.