mayavi2 drawing of plot broken

Bug #916307 reported by Bryce Ready
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mayavi2 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Steps to reproduce:

python
>>from mayavi import mlab
>>mlab.points3d(0,0,0)

What I expect: a mayavi figure window with a single sphere centered at the origin

What I get: a mayavi figure window that doesn't refresh (if I drag another window over it temporarily, the figure window will still show the contents of that window)

I am running oneiric, and the mayavi2 package is installed. It's version is 4.0.0-1ubuntu1

I am running python 2.7.2-5ubuntu1

I am using nvidia drivers (nvidia-current)

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: mayavi2 4.0.0-1ubuntu1
ProcVersionSignature: Ubuntu 3.0.0-14.23-generic-pae 3.0.9
Uname: Linux 3.0.0-14-generic-pae i686
NonfreeKernelModules: nvidia
ApportVersion: 1.23-0ubuntu4
Architecture: i386
Date: Fri Jan 13 16:37:15 2012
InstallationMedia: Xubuntu 11.10 "Oneiric Ocelot" - Release i386 (20111012)
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: mayavi2
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Bryce Ready (bryce-ready) wrote :
Revision history for this message
Julian Taylor (jtaylor) wrote :

this is probably the expected behavior.
the default python shell does not integrate with the event loop used by mayavi (wx's I think)

you have to use a better shell to have interactive features.
e.g. ipython

ipython -wthread
In [1]: from mayavi import mlab
In [2]: mlab.points3d(0,0,0)

ipython --gui wx if you have ipython >= 0.11

Changed in mayavi2 (Ubuntu):
status: New → Invalid
Revision history for this message
Gael Varoquaux (gael-varoquaux) wrote : Re: [Bug 916307] [NEW] mayavi2 drawing of plot broken

On Fri, Jan 13, 2012 at 11:50:47PM -0000, Bryce Ready wrote:
> python
> >>from mayavi import mlab
> >>mlab.points3d(0,0,0)

Are you running this in a standard Python interpreter?

As said in many places in the Mayavi documentation (e.g. the big red
warning on http://github.enthought.com/mayavi/mayavi/mlab.html ), for the
interactivity to work, you _need_ to run it IPython, with the 'wthread'
option enabled. It cannot work in a standard Python interpreter.

Revision history for this message
Bryce Ready (bryce-ready) wrote :

Yes, the example I gave was run from a regular python interpreter. I was trying to use the simplest case possible, and ended up introducing confusion - my apologies. I'm aware of the GUI threading issues involved, and had actually first encountered this problem from ipython. Again, sorry to be causing confusion.

The screen refresh is not really the problem I was after here. If I add 'mlab.show()' to my example, I still get a black screen (which does redraw, even in a regular interpreter) that blocks the interactive python thread (which doesn't matter for this example). After doing a bit more digging, I think the problem is that the default foreground and background color are both set to black. If I modify the example like so:

python
>>> from mayavi import mlab
>>> mlab.figure(bgcolor=(0.5,0.5,0.5))
<mayavi.core.scene.Scene object at 0xbe92a4c>
>>> mlab.points3d(0,0,0,color=(1,0,0))
<mayavi.modules.glyph.Glyph object at 0xbe92d1c>
>>> mlab.show()

I get a fully interactive window with a red sphere in the middle, as expected.

I should note that I have a local install (to ${HOME}/.local) of numpy 1.6.1, and have tweaked PYTHONPATH such that this is what gets loaded when I do import numpy (I really really need einsum). I doubt this could be breaking mayavi, but figured I should disclose it to be sure.

This problem can certainly be worked around, but it is very annoying. Any tips on where the default colors can be set? My suspicion is that this is just a packaging bug.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.