Take the 2-minute tour ×

I am using matplotlib to create a 3d bar plot like this one.

Unfortunately matplotlib 3d plotting capabilities are very limiting and have a few bugs (e.g. it can't render properly some viewing angles).

MayaVI2 offers a solution to this problem but I have not found a way to make the size of the bars uneven. In matplotlib you can just give the bar edges as an array using the bar3d function.

Has anyone tried this with mayavi2?

I tried to use barchart from mayavi.

from pylab import *
from mayavi.mlab import *

#define bin edges
x = [1,2,3,5,7,12]
y = [1,2,3,5,7,12]
X, Y = np.meshgrid(x,y)
S = rand(len(x), len(y))

Which resulted in all bins with the same width.

share|improve this question
Can you include what you have tried in mayavi? It is easier to help if we have something to start with. –  tcaswell Nov 26 '13 at 18:37
just edited the question to include a sample code using mayavi. –  user3037698 Nov 27 '13 at 10:12
In what way does your sample code use mayavi? –  aestrivex Nov 30 '13 at 0:55
it uses in the boxplot function. –  user3037698 Dec 2 '13 at 16:10
Sure about that? mayavi.mlab has no attribute 'boxplot' using the current between-releases development version. What versions of matplotlib and mayavi are you using? –  aestrivex Dec 3 '13 at 15:59
show 3 more comments


Your Answer



Browse other questions tagged or ask your own question.