Questions tagged [mayavi.mlab]

Questions on the Mayavi mlab API, for scripting Mayavi using Python

Additional information:

  1. MLab reference - Reference list of all the main functions of mayavi.mlab with documentation and examples.
  2. Documentation
131 questions
8
votes
1 answer

Mayavi how to show the axes grid

In Mayavi I would like to see the grid of the axes in the following plot # Source: <>. import numpy as np from mayavi import mlab # Test data: Matlab `peaks()` x, y = np.mgrid[-3:3:50j, -3:3:50j] z =…
Adriaan
  • 715
  • 10
  • 22
7
votes
2 answers

how to create a 3D height map

I have a 2D array Z that stores the height at that element's position. Other than using the method here in which I need to create array X and Y with the same size as Z, are there any simpler methods to create a 3D height map? The 3D surface height…
Physicist
  • 2,848
  • 8
  • 33
  • 62
7
votes
1 answer

Is it possible to plot implicit 3d equation using sympy?

Is there a way to plot a 3 variable implicit equation using sympy. Going by docs it has only support for implicit 2d plots. Or are there any other options for plotting a 3d plot using python where the equation can be an input from user
Srinath Mandava
  • 3,384
  • 2
  • 24
  • 37
6
votes
1 answer

mayavi mlab.savefig() gives an empty image

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] =…
Johan
  • 105
  • 1
  • 6
6
votes
1 answer

Does Mayavi "Font Size" text property work?

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…
paradiso
  • 379
  • 3
  • 14
5
votes
1 answer

Plot 3D curve on top of 3D surface

I'm trying to plot a 3D curve on top of a 3D surface in Matplotlib, but when the curve is in front of the surface, it is barely visible (the curve is the image of the unit circle): There should be a green curve floating one unit above the…
tttapa
  • 1,397
  • 12
  • 26
5
votes
0 answers

Importing mlab from mayavi or vtk : the kernel died

I have tried installing mayavi for several days, without results. I'm using spyder and anaconda. I can import mayavi on spyder without problem, but when I try importing vtk or from mayavi import mlab, the kernel died. I read a lot on the subject…
Amanda H
  • 51
  • 1
5
votes
2 answers

How to set parallel perspective on a 3d plot

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 =…
anon01
  • 10,618
  • 8
  • 35
  • 58
5
votes
1 answer

Enthought Canopy Mayavi font size bug

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…
dcnicholls
  • 391
  • 1
  • 5
  • 15
5
votes
1 answer

Constrain Mayavi mouse drag to rotating Earth around its axis

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,…
Brandon Rhodes
  • 83,755
  • 16
  • 106
  • 147
4
votes
0 answers

Mayavi : surface plot and 3D contours

Good evening everyone, I am a long time user of Matplotlib and I recently discovered Mayavi. With Matplotlib, I can plot a 3D surface with projected contours of the surface plot for each axis and I was wondering if the same could be done with…
Loïc Poncin
  • 511
  • 1
  • 11
  • 30
4
votes
0 answers

Mayavi.mlab: scale/limit/set axes or aspect ratio

I have data that essentially looks like that: (minimum working example) import mayavi.mlab as mlab pts = mlab.points3d([1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,500], [1,2,3,4,100]) mlab.show() And this already shows my problem: because of the huge…
Julian
  • 299
  • 2
  • 15
4
votes
1 answer

mayavi mapping a discrete colorbar on a surface

I want to change the color of a surface depending on another value (an ID) that takes discrete values (so I need a discrete colorbar). In the simplified example below I have drawn a sphere with 3 different IDs: 0/red on the left 2/blue on the…
4
votes
1 answer

MayaVi: mlab segfaults on display

I am trying to learn MayaVi, but getting stuck on opening figures. Displaying figures in mlab just results in a segfault. It does not seem to matter what I plot, so I think that the problem is in the act of displaying, not in the object I am trying…
4
votes
2 answers

invert colormap in mlab

I simply want to know how to invert a colormap in mlab. I know in matplotlib you can simply add _r to the name of the colormap to invert the color scheme. However it appears to be slightly different in mlab. Does anyone know how this can be…
user1750948
  • 719
  • 2
  • 10
  • 27
1
2 3
8 9