Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4d3f787

Browse files
committed
tools
1 parent 3af2220 commit 4d3f787

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

plotly/tools.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,7 @@ def _tri_indices(simplices):
15551555
return ([triplet[c] for triplet in simplices] for c in range(3))
15561556

15571557
@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,
15591559
plot_edges=None, x_edge=None, y_edge=None, z_edge=None):
15601560
"""
15611561
Refer to FigureFactory.create_trisurf() for docstring
@@ -1571,7 +1571,7 @@ def _trisurf(x, y, z, simplices, colormap=None, dist_func=None,
15711571
# vertices of the surface triangles
15721572
tri_vertices = list(map(lambda index: points3D[index], simplices))
15731573

1574-
if not dist_func:
1574+
if not color_func:
15751575
# mean values of z-coordinates of triangle vertices
15761576
mean_dists = [np.mean(tri[:, 2]) for tri in tri_vertices]
15771577
else:
@@ -1582,7 +1582,7 @@ def _trisurf(x, y, z, simplices, colormap=None, dist_func=None,
15821582
for triangle in tri_vertices:
15831583
dists = []
15841584
for vertex in triangle:
1585-
dist = dist_func(vertex[0], vertex[1], vertex[2])
1585+
dist = color_func(vertex[0], vertex[1], vertex[2])
15861586
dists.append(dist)
15871587

15881588
mean_dists.append(np.mean(dists))
@@ -1633,7 +1633,7 @@ def _trisurf(x, y, z, simplices, colormap=None, dist_func=None,
16331633

16341634
@staticmethod
16351635
def create_trisurf(x, y, z, simplices, colormap=None,
1636-
dist_func=None, title='Trisurf Plot',
1636+
color_func=None, title='Trisurf Plot',
16371637
showbackground=True,
16381638
backgroundcolor='rgb(230, 230, 230)',
16391639
gridcolor='rgb(255, 255, 255)',
@@ -1654,7 +1654,7 @@ def create_trisurf(x, y, z, simplices, colormap=None,
16541654
hex or tuple types. An rgb/triplet color type is a triplet of the
16551655
form (a,b,c) or 'rgb(x,y,z)' respectively where a,b,c belong to
16561656
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
16581658
coloring of the surface changes. It takes 3 arguments x, y, z and
16591659
must return a formula of these variables which can include numpy
16601660
functions (eg. np.sqrt). If set to None, color will only depend on
@@ -1808,7 +1808,7 @@ def dist_origin(x, y, z):
18081808
'rgb(50, 150, 255)',
18091809
(0.2, 0.2, 0.8)],
18101810
simplices=simplices,
1811-
dist_func=dist_origin)
1811+
color_func=dist_origin)
18121812
# Plot the data
18131813
py.iplot(fig1, filename='Trisurf Plot - Custom Coloring')
18141814
```
@@ -1916,7 +1916,7 @@ def dist_origin(x, y, z):
19161916
"a list of any color types.")
19171917

19181918
data1 = FigureFactory._trisurf(x, y, z, simplices,
1919-
dist_func=dist_func,
1919+
color_func=color_func,
19201920
colormap=colormap,
19211921
plot_edges=True)
19221922
axis = dict(

0 commit comments

Comments
 (0)