@@ -1555,7 +1555,7 @@ def _tri_indices(simplices):
1555
1555
return ([triplet [c ] for triplet in simplices ] for c in range (3 ))
1556
1556
1557
1557
@staticmethod
1558
- def _trisurf (x , y , z , simplices , colormap = None , dist_func = None ,
1558
+ def _trisurf (x , y , z , simplices , colormap = None , color_func = None ,
1559
1559
plot_edges = None , x_edge = None , y_edge = None , z_edge = None ):
1560
1560
"""
1561
1561
Refer to FigureFactory.create_trisurf() for docstring
@@ -1571,7 +1571,7 @@ def _trisurf(x, y, z, simplices, colormap=None, dist_func=None,
1571
1571
# vertices of the surface triangles
1572
1572
tri_vertices = list (map (lambda index : points3D [index ], simplices ))
1573
1573
1574
- if not dist_func :
1574
+ if not color_func :
1575
1575
# mean values of z-coordinates of triangle vertices
1576
1576
mean_dists = [np .mean (tri [:, 2 ]) for tri in tri_vertices ]
1577
1577
else :
@@ -1582,7 +1582,7 @@ def _trisurf(x, y, z, simplices, colormap=None, dist_func=None,
1582
1582
for triangle in tri_vertices :
1583
1583
dists = []
1584
1584
for vertex in triangle :
1585
- dist = dist_func (vertex [0 ], vertex [1 ], vertex [2 ])
1585
+ dist = color_func (vertex [0 ], vertex [1 ], vertex [2 ])
1586
1586
dists .append (dist )
1587
1587
1588
1588
mean_dists .append (np .mean (dists ))
@@ -1633,7 +1633,7 @@ def _trisurf(x, y, z, simplices, colormap=None, dist_func=None,
1633
1633
1634
1634
@staticmethod
1635
1635
def create_trisurf (x , y , z , simplices , colormap = None ,
1636
- dist_func = None , title = 'Trisurf Plot' ,
1636
+ color_func = None , title = 'Trisurf Plot' ,
1637
1637
showbackground = True ,
1638
1638
backgroundcolor = 'rgb(230, 230, 230)' ,
1639
1639
gridcolor = 'rgb(255, 255, 255)' ,
@@ -1654,7 +1654,7 @@ def create_trisurf(x, y, z, simplices, colormap=None,
1654
1654
hex or tuple types. An rgb/triplet color type is a triplet of the
1655
1655
form (a,b,c) or 'rgb(x,y,z)' respectively where a,b,c belong to
1656
1656
the interval [0,1] and x,y,z belong to [0,255]
1657
- :param (function) dist_func : The function that determines how the
1657
+ :param (function) color_func : The function that determines how the
1658
1658
coloring of the surface changes. It takes 3 arguments x, y, z and
1659
1659
must return a formula of these variables which can include numpy
1660
1660
functions (eg. np.sqrt). If set to None, color will only depend on
@@ -1808,7 +1808,7 @@ def dist_origin(x, y, z):
1808
1808
'rgb(50, 150, 255)',
1809
1809
(0.2, 0.2, 0.8)],
1810
1810
simplices=simplices,
1811
- dist_func =dist_origin)
1811
+ color_func =dist_origin)
1812
1812
# Plot the data
1813
1813
py.iplot(fig1, filename='Trisurf Plot - Custom Coloring')
1814
1814
```
@@ -1916,7 +1916,7 @@ def dist_origin(x, y, z):
1916
1916
"a list of any color types." )
1917
1917
1918
1918
data1 = FigureFactory ._trisurf (x , y , z , simplices ,
1919
- dist_func = dist_func ,
1919
+ color_func = color_func ,
1920
1920
colormap = colormap ,
1921
1921
plot_edges = True )
1922
1922
axis = dict (
0 commit comments