Révision | 377e0adeefed11610507cdea5ff059613e561f50 (tree) |
---|---|
l'heure | 2012-06-17 03:41:25 |
Auteur | lorenzo |
Commiter | lorenzo |
Modifications in the script to keep up with changes in mayavi2 mlab's syntax.
@@ -1,16 +1,17 @@ | ||
1 | 1 | #! /usr/bin/env python |
2 | 2 | import numpy as np |
3 | -from enthought.mayavi import mlab | |
3 | +from mayavi import mlab | |
4 | 4 | |
5 | 5 | x, y, z = 10*np.random.random((3, 100)) |
6 | 6 | s = np.random.random_integers(10 ,size=(100, )) |
7 | 7 | mlab.clf() |
8 | 8 | pts = mlab.points3d(x, y, z, s, colormap='jet', scale_mode='none', |
9 | 9 | resolution=20) |
10 | -cbar = mlab.colorbar(pts, title="Number of first neighbors") | |
11 | -cbar.number_of_labels = 10 | |
12 | -cbar.maximum_number_of_colors = 10 | |
13 | -cbar.label_format = '%.0f' | |
10 | +cbar = mlab.colorbar(pts, title="Number of first neighbors", \ | |
11 | + nb_labels=10, nb_colors=10, label_fmt='%.0f') | |
12 | +# cbar.number_of_labels = 10 | |
13 | +# cbar.maximum_number_of_colors = 10 | |
14 | +# cbar.label_format = '%.0f' | |
14 | 15 | |
15 | 16 | # We need to force a redraw. |
16 | 17 | mlab.draw() |