mayavi

Disable or Catch VTK warnings in vtkOutputWindow when embedding Mayavi

会有一股神秘感。 提交于 2019-12-21 12:42:06
问题 I'd like to either disable the VTK warning window or, better yet, catch them to handle with my application's logging system. My application is using an embedded mayavi view, and I don't want error windows popping up that I have no control over. The following code demonstrates the warning window. import numpy as np from mayavi import mlab x1 = np.array([1, 1, 2, 3]) y1 = np.array([1, 1, 4, 2]) z1 = np.array([1, 1, 5, 1]) mlab.plot3d(x1, y1, z1) mlab.show() Ok, I've done some research and

Install VTK with anaconda 3.6

ぃ、小莉子 提交于 2019-12-20 03:43:16
问题 I need to install VTK and mayavi on Ubuntu 16. I have Anaconda with Python 3.6. If I run: conda install -c menpo vtk=7.0.0 vtk I get: Fetching package metadata ........... Solving package specifications: . UnsatisfiableError: The following specifications were found to be in conflict: - python 3.6* - vtk 7.0.0* -> python 3.5* -> openssl 1.0.1* - vtk 7.0.0* -> python 3.5* -> xz 5.0.5 Use "conda info <package>" to see the dependencies for each package. Apparently, I need Anaconda with Python3.5,

Gtk-WARNING **: Locale not supported by C library. while using several Python modules (mayavi, spectral)

℡╲_俬逩灬. 提交于 2019-12-20 02:36:06
问题 I updated my MacBook to Mavericks, reinstalled Macports and all Python 2.7 modules I usually use. While running Python I get the following messages: when importing mlab: from mayavi import lab (process:1146): Gtk-WARNING **: Locale not supported by C library. Using the fallback 'C' locale. when running a mlab command such as mlab.mesh(), the display window opens, shows no content and freezes. I don't get this message while importing spectral, but I get it when running view_cube() the display

Get mayavi working with Python 3

寵の児 提交于 2019-12-18 13:03:21
问题 I'm having trouble running mayavi in python 3.3 When running my program with python3 (or python3.3) i get from mayavi import mlab as ml ImportError: No module named 'mayavi' To get numpy and matplotlib to work, i used: sudo apt-get install python3-"missing module" But the usual way to install mayavi is just sudo apt-get install mayavi2 And python3 doesn't find it.... Does anyone know a way to get mayavi to work with Python3? Is it not supported yet? I have tried both import mayavi.mlab as ml

Get mayavi working with Python 3

﹥>﹥吖頭↗ 提交于 2019-12-18 13:03:11
问题 I'm having trouble running mayavi in python 3.3 When running my program with python3 (or python3.3) i get from mayavi import mlab as ml ImportError: No module named 'mayavi' To get numpy and matplotlib to work, i used: sudo apt-get install python3-"missing module" But the usual way to install mayavi is just sudo apt-get install mayavi2 And python3 doesn't find it.... Does anyone know a way to get mayavi to work with Python3? Is it not supported yet? I have tried both import mayavi.mlab as ml

Specify absolute colour for 3D points in MayaVi

笑着哭i 提交于 2019-12-17 23:44:52
问题 I am using the MayaVi Python library to plot 3d points, using the points3d class. The documentation specifies that the colour of each point is specified through a fourth argument, s : In addition, you can pass a fourth array s of the same shape as x, y, and z giving an associated scalar value for each point, or a function f(x, y, z) returning the scalar value. This scalar value can be used to modulate the color and the size of the points. This specifies a scalar value for each point, which

Animating a mayavi points3d plot

人走茶凉 提交于 2019-12-17 16:27:44
问题 I'm trying to make a video of the trajectories of particles. However, somehow my scene never updates. Here's a very simple example: from __future__ import absolute_import, division, print_function from mayavi import mlab import numpy as np import math alpha = np.linspace(0, 2*math.pi, 100) xs = np.cos(alpha) ys = np.sin(alpha) zs = np.zeros_like(xs) mlab.points3d(0,0,0) plt = mlab.points3d(xs[:1], ys[:1], zs[:1]) @mlab.animate(delay=100) def anim(): f = mlab.gcf() while True: for (x, y, z) in

How to obscure a line behind a surface plot in matplotlib?

淺唱寂寞╮ 提交于 2019-12-17 04:34:13
问题 I want to plot data using Matplotlib via a colormap on the surface of a sphere. Additionally, I would like to add a 3D line plot. The code I have so far is this: import matplotlib import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np NPoints_Phi = 30 NPoints_Theta = 30 radius = 1 pi = np.pi cos = np.cos sin = np.sin phi_array = ((np.linspace(0, 1, NPoints_Phi))**1) * 2*pi theta_array = (np.linspace(0, 1, NPoints_Theta) **1) * pi phi, theta = np.meshgrid

How to install Mayavi Trait backends?

只愿长相守 提交于 2019-12-14 03:41:28
问题 OS: Linux Kubuntu 14.4.5 Python: Python 3.5.2 :: Continuum Analytics, Inc. I tried to install Mayavi into my anaconda environment: conda install -c menpo mayavi=4.5.0 conda install -c anaconda wxpython=3.0.0.0 conda install pyqt conda install qt But when I try to run the example from http://docs.enthought.com/mayavi/mayavi/auto/example_surface_from_irregular_data.html I get the error message ImportError: Could not import backend for traits with the explanation: Make sure that you have either

How to join/connect/group multiple objects in Mayavi2

醉酒当歌 提交于 2019-12-13 16:09:12
问题 I would like to combine multiple Mayavi objects into a single "grouped" object so that I control all of their properties together. For example I created the following bi-convex lens shape by combining 3 built-in surfaces (two spheres and one cylinder). Now I would like to assign uniform properties (specularity, ambient color, etc) to all of the constituent surfaces at a time (not individually). Also, I would like to translate/rotate the lens as a whole. I am not sure how to accomplish this.