mayavi.mlab

Change mlab quiver3d & surf data sources without clearing figure in traits script

久未见 提交于 2019-12-11 05:28:14
问题 I have a Traits and Mayavi script that presents an mlab scene and several traits editors. The editors affect what data is shown in a surface , quiver3d and legend (Scalar LUT Manager) by calling my drawing method. Each change triggers a clear figure and re-draw. Learning from the Mlab interactive dialog example the plot3d * uses mlab_source.set to change the data without clearing the figure and re-drawing. In update_plot(): if self.plot is None: self.plot = self.scene.mlab.plot3d(x, y, z, t,

Constrain Mayavi mouse drag to rotating Earth around its axis

廉价感情. 提交于 2019-12-07 10:10:45
问题 Using iPython Notebook, I have been able to bring up a globe of the Earth with code like: from mayavi import mlab from mayavi.sources.builtin_surface import BuiltinSurface ocean_blue = (0.4, 0.5, 1.0) r = 6371 # km sphere = mlab.points3d(0, 0, 0, name='Globe', scale_mode='none', scale_factor=r * 2.0, color=ocean_blue, resolution=50) sphere.actor.property.specular = 0.20 sphere.actor.property.specular_power = 10 continents_src = BuiltinSurface(source='earth', name='Continents') continents_src

Constrain Mayavi mouse drag to rotating Earth around its axis

邮差的信 提交于 2019-12-05 16:16:21
Using iPython Notebook, I have been able to bring up a globe of the Earth with code like: from mayavi import mlab from mayavi.sources.builtin_surface import BuiltinSurface ocean_blue = (0.4, 0.5, 1.0) r = 6371 # km sphere = mlab.points3d(0, 0, 0, name='Globe', scale_mode='none', scale_factor=r * 2.0, color=ocean_blue, resolution=50) sphere.actor.property.specular = 0.20 sphere.actor.property.specular_power = 10 continents_src = BuiltinSurface(source='earth', name='Continents') continents_src.data_source.on_ratio = 1 # detail level continents_src.data_source.radius = r continents = mlab

Does Mayavi “Font Size” text property work?

断了今生、忘了曾经 提交于 2019-12-01 17:06:25
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? I've just downloaded, and installed it, and I seem to be having the same problem. On Windows 8 right now. This is probably a

mayavi mlab.savefig() gives an empty image

江枫思渺然 提交于 2019-11-30 21:17:18
I am trying to learn mayavi2 for python and can not get my savefig to show my plots. I found this example code: from numpy import pi, sin, cos, mgrid dphi, dtheta = pi/250.0, pi/250.0 [phi,theta] = mgrid[0:pi+dphi*1.5:dphi,0:2*pi+dtheta*1.5:dtheta] m0 = 4; m1 = 3; m2 = 2; m3 = 3; m4 = 6; m5 = 2; m6 = 6; m7 = 4; r = sin(m0*phi)**m1 + cos(m2*phi)**m3 + sin(m4*theta)**m5 + cos(m6*theta)**m7 x = r*sin(phi)*cos(theta) y = r*cos(phi) z = r*sin(phi)*sin(theta) # View it. from mayavi import mlab a= mlab.mesh(x, y, z) mlab.show() Now I want to save the figure, so I add: mlab.savefig(filename='test.png'

mayavi mlab.savefig() gives an empty image

一世执手 提交于 2019-11-30 17:11:28
问题 I am trying to learn mayavi2 for python and can not get my savefig to show my plots. I found this example code: from numpy import pi, sin, cos, mgrid dphi, dtheta = pi/250.0, pi/250.0 [phi,theta] = mgrid[0:pi+dphi*1.5:dphi,0:2*pi+dtheta*1.5:dtheta] m0 = 4; m1 = 3; m2 = 2; m3 = 3; m4 = 6; m5 = 2; m6 = 6; m7 = 4; r = sin(m0*phi)**m1 + cos(m2*phi)**m3 + sin(m4*theta)**m5 + cos(m6*theta)**m7 x = r*sin(phi)*cos(theta) y = r*cos(phi) z = r*sin(phi)*sin(theta) # View it. from mayavi import mlab a=

Enthought Canopy Mayavi font size bug

独自空忆成欢 提交于 2019-11-29 14:49:19
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? 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 attribute: >> ax=mlab.axes() >> ax.axes.font_factor 1.5 >> ax.axes.font_factor=2 It only produces a small increase