Revisão | 7da4e5e47985919085845188a56fd59da76d7135 (tree) |
---|---|
Hora | 2012-06-17 03:36:16 |
Autor | lorenzo |
Commiter | lorenzo |
I slightly changed the syntax: I import mlab in a different way and I moved
the specifications about the colorbar inside the definition of the colorbar
itself (for some reason, they stopped working in the old way. Probably an
updated syntax of the software).
@@ -1,6 +1,8 @@ | ||
1 | 1 | #! /usr/bin/env python |
2 | 2 | |
3 | -from enthought.mayavi import mlab | |
3 | +# from enthought.mayavi import mlab | |
4 | + | |
5 | +from mayavi import mlab | |
4 | 6 | |
5 | 7 | import scipy as s |
6 | 8 | import numpy as n |
@@ -8,7 +10,7 @@ | ||
8 | 10 | import sys |
9 | 11 | |
10 | 12 | kf=1.3 |
11 | -df= 2.1 # 1.8 | |
13 | +df= 2.3 # 1.8 | |
12 | 14 | |
13 | 15 | print sys.argv |
14 | 16 |
@@ -108,7 +110,7 @@ | ||
108 | 110 | |
109 | 111 | |
110 | 112 | dist_mat=euclidean_distances(final_cluster,final_cluster) |
111 | -n.savetxt("distances.dat",n.ravel(dist_mat)) | |
113 | + | |
112 | 114 | |
113 | 115 | print "s.shape(dist_mat) is, ", s.shape(dist_mat) |
114 | 116 |
@@ -139,10 +141,10 @@ | ||
139 | 141 | mlab.clf() |
140 | 142 | pts = mlab.points3d(x, y, z, k, colormap='jet', scale_mode='none',\ |
141 | 143 | resolution=20, scale_factor=2) |
142 | -cbar = mlab.colorbar(pts, title="Number of first neighbors") | |
143 | -cbar.number_of_labels = n_lab | |
144 | -cbar.maximum_number_of_colors =n_lab | |
145 | -cbar.label_format = '%.0f' | |
144 | +cbar = mlab.colorbar(pts, title="Number of first neighbors",nb_labels = n_lab, nb_colors=n_lab, label_fmt= '%.0f') | |
145 | +# cbar.number_of_labels = n_lab | |
146 | +# cbar.maximum_number_of_colors =n_lab | |
147 | +# cbar.label_format = '%.0f' | |
146 | 148 | |
147 | 149 | # We need to force a redraw. |
148 | 150 | mlab.draw() |