installing Mayavi with pip – no module named vtk

I’m on Debian but this should work for you as well I was stuck with installing vtk into a virtualenv, after hours of search with no results I did the following and it worked. install python-vtk from repositories systemwide copy vtk folder from /usr/lib/pymodules/python2.7 to /PATH/TO/YOUR/VIRTUALENV/lib/python2.7/site-packages In your case the system-wide python packages folder would … Read more

How to plot a 3D density map in python with matplotlib

Thanks to mwaskon for suggesting the mayavi library. I recreated the density scatter plot in mayavi as follows: import numpy as np from scipy import stats from mayavi import mlab mu, sigma = 0, 0.1 x = 10*np.random.normal(mu, sigma, 5000) y = 10*np.random.normal(mu, sigma, 5000) z = 10*np.random.normal(mu, sigma, 5000) xyz = np.vstack([x,y,z]) kde = … Read more

Is it possible to directly apply an affine transformation matrix to a Mayavi ImageActor object?

ImageActor, which ultimately is a wrapper for tvtk.ImageActor, has a user_matrix property, which lets you assign a 4D transformation matrix. Starting with a random image, import numpy as np from mayavi.mlab import imshow s = np.random.random((10, 10)) image = imshow(s, colormap=’gist_earth’, interpolate=False) gives us the following … Creating a transformation matrix and setting a term … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)