@@ -183,6 +183,7 @@ def do_3d_projection(self, renderer):
183
183
segments_2d = [zip (xs , ys ) for (xs , ys , zs ) in xyslist ]
184
184
LineCollection .set_segments (self , segments_2d )
185
185
186
+ # FIXME
186
187
minz = 1e9
187
188
for (xs , ys , zs ) in xyslist :
188
189
minz = min (minz , min (zs ))
@@ -300,6 +301,9 @@ def set_sort_zpos(self,val):
300
301
self ._sort_zpos = val
301
302
302
303
def set_3d_properties (self , zs , zdir ):
304
+ # Force the collection to initialize the face and edgecolors
305
+ # just in case it is a scalarmappable with a colormap.
306
+ self .update_scalarmappable ()
303
307
offsets = self .get_offsets ()
304
308
if len (offsets ) > 0 :
305
309
xs , ys = zip (* self .get_offsets ())
@@ -416,6 +420,9 @@ def set_verts(self, verts, closed=True):
416
420
PolyCollection .set_verts (self , [], closed )
417
421
418
422
def set_3d_properties (self ):
423
+ # Force the collection to initialize the face and edgecolors
424
+ # just in case it is a scalarmappable with a colormap.
425
+ self .update_scalarmappable ()
419
426
self ._sort_zpos = None
420
427
self .set_zsort (True )
421
428
self ._facecolors3d = PolyCollection .get_facecolors (self )
@@ -429,7 +436,7 @@ def do_3d_projection(self, renderer):
429
436
'''
430
437
Perform the 3D projection for this object.
431
438
'''
432
-
439
+ # FIXME: This may no longer be needed?
433
440
if self ._A is not None :
434
441
self .update_scalarmappable ()
435
442
self ._facecolors3d = self ._facecolors
@@ -572,6 +579,10 @@ def get_colors(c, num):
572
579
573
580
def zalpha (colors , zs ):
574
581
"""Modify the alphas of the color list according to depth"""
582
+ # FIXME: This only works well if the points for *zs* are well-spaced
583
+ # in all three dimensions. Otherwise, at certain orientations,
584
+ # the min and max zs are very close together.
585
+ # Should really normalize against the viewing depth.
575
586
colors = get_colors (colors , len (zs ))
576
587
if zs .size > 0 :
577
588
norm = Normalize (min (zs ), max (zs ))
0 commit comments