mayavi.mlab

Mayavi how to show the axes grid

故事扮演 提交于 2021-02-07 07:12:05
问题 In Mayavi I would like to see the grid of the axes in the following plot # Source: <<https://scicomp.stackexchange.com/a/23148/10048>>. import numpy as np from mayavi import mlab # Test data: Matlab `peaks()` x, y = np.mgrid[-3:3:50j, -3:3:50j] z = 3*(1 - x)**2 * np.exp(-x**2 - (y + 1)**2) \ - 10*(x/5 - x**3 - y**5)*np.exp(-x**2 - y**2) \ - 1./3*np.exp(-(x + 1)**2 - y**2) mlab.figure(bgcolor=(1, 1, 1)) # Make background white. surf = mlab.surf(x, y, z, colormap='RdYlBu', warp_scale=0.3,

Mayavi how to show the axes grid

假如想象 提交于 2021-02-07 07:06:32
问题 In Mayavi I would like to see the grid of the axes in the following plot # Source: <<https://scicomp.stackexchange.com/a/23148/10048>>. import numpy as np from mayavi import mlab # Test data: Matlab `peaks()` x, y = np.mgrid[-3:3:50j, -3:3:50j] z = 3*(1 - x)**2 * np.exp(-x**2 - (y + 1)**2) \ - 10*(x/5 - x**3 - y**5)*np.exp(-x**2 - y**2) \ - 1./3*np.exp(-(x + 1)**2 - y**2) mlab.figure(bgcolor=(1, 1, 1)) # Make background white. surf = mlab.surf(x, y, z, colormap='RdYlBu', warp_scale=0.3,

Mayavi how to show the axes grid

谁说我不能喝 提交于 2021-02-07 07:05:15
问题 In Mayavi I would like to see the grid of the axes in the following plot # Source: <<https://scicomp.stackexchange.com/a/23148/10048>>. import numpy as np from mayavi import mlab # Test data: Matlab `peaks()` x, y = np.mgrid[-3:3:50j, -3:3:50j] z = 3*(1 - x)**2 * np.exp(-x**2 - (y + 1)**2) \ - 10*(x/5 - x**3 - y**5)*np.exp(-x**2 - y**2) \ - 1./3*np.exp(-(x + 1)**2 - y**2) mlab.figure(bgcolor=(1, 1, 1)) # Make background white. surf = mlab.surf(x, y, z, colormap='RdYlBu', warp_scale=0.3,

animating with mayavi mlab.points3d

六月ゝ 毕业季﹏ 提交于 2020-06-16 18:40:55
问题 Hello everyone i am trying to animate some data using Mayavi mlab.points3d and having some issues. Here is my code: import numpy as np from mayavi import mlab ##Some lists to animate px=np.arange(0,10000,1) py=np.arange(0,50000,5) ##Animation function def run(px,py): cc = mlab.gcf().scene.camera cc.position[-1] = 10 T_max = len(px) delayer=40 @mlab.animate(delay=delayer) def anim_loc(): f = mlab.gcf() while True: for i in np.arange(0,T_max,1): s=0.5 mlab.points3d(px[i],py[i],s,color=(0,0,0)

animating with mayavi mlab.points3d

你。 提交于 2020-06-16 18:39:08
问题 Hello everyone i am trying to animate some data using Mayavi mlab.points3d and having some issues. Here is my code: import numpy as np from mayavi import mlab ##Some lists to animate px=np.arange(0,10000,1) py=np.arange(0,50000,5) ##Animation function def run(px,py): cc = mlab.gcf().scene.camera cc.position[-1] = 10 T_max = len(px) delayer=40 @mlab.animate(delay=delayer) def anim_loc(): f = mlab.gcf() while True: for i in np.arange(0,T_max,1): s=0.5 mlab.points3d(px[i],py[i],s,color=(0,0,0)

Does Mayavi “Font Size” text property work?

≡放荡痞女 提交于 2020-01-11 08:44:11
问题 Is there a bug in the Mayavi font rendering that prevents changing the font size? I am using the Mayavi2 GUI to change the font size of the axis labels on a volumetric plot. To get there I go to: Scene -> Scalar Field -> Colors and Legends -> Axes -> Label Text (tab) -> Font Size Changing this number does not affect the size of the fonts in the image. Is this a known bug? I have seen no reference to it on Google. How do you change the text size on your mayavi figures? 回答1: I've just

Enthought Canopy Mayavi font size bug

Deadly 提交于 2019-12-29 08:43:07
问题 The font size setting in Enthough Canopy Mayavi mlab appears to be broken. Neither the command: mlab.axes.label_text_property.font_size = 12 (e.g.) nor the direct menu font size command (advanced settings) works. I have logged a bug report with Enthought, but it looks like a more general Mayavi bug, see Does Mayavi "Font Size" text property work? 回答1: As you say this is a bug that has to do with the translation between the mayavi layer and the vtk layer. But for now you could use this

Setting parallel prospective in mlab/mayavi/python

非 Y 不嫁゛ 提交于 2019-12-23 10:37:20
问题 I have a code in python to render a few spheres in python that looks like this: %matplotlib inline import numpy as np import matplotlib.pyplot as plt import random import mayavi from mayavi import mlab N = 4; diams = .4*np.ones([N]); xvals = np.arange(N); yvals = np.zeros(N); zvals = np.zeros(N); pts = mlab.points3d(xvals, yvals, zvals, diams, scale_factor=1,transparent=True) mlab.show() The default view of the figure adds distortion based on the camera position (farther spheres smaller). I'd

From mayavi import mlab error

孤者浪人 提交于 2019-12-12 02:29:18
问题 I am new to using python and have had some trouble getting the mlab module within mayavi to work. In my script I can import mayavi just fine, but when I include the line: from mayavi import mlab it produces the error : Fatal Python error: PyThreadState_Get: no current thread Abort trap: 6 I have spent a few hours trying to fix this error, but have come up empty handed. Does anyone know why this line specifically crashes? I can import other modules just fine, but the mlab one doesn't work.

Mayavi multiple scene selector

做~自己de王妃 提交于 2019-12-11 15:48:32
问题 I need to load multiple scenes with option to switch them. Something like on the image: For button "1" something like mlab.points3d(x1, y1, z1, s1, color=blue) For button "2" something like mlab.points3d(x2, y2, z2, s2, color=red) For button "3" something like mlab.points3d(x3, y3, z3, s3, color=green) How to manage drawing inside another scene? (I suppose that mlab.points3d should be done before option to switch between scenes). And how to define buttons for scheme switching? 回答1: Here is an