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

Skip to content

Commit 3632084

Browse files
committed
Make docs a little bit more consistent.
1 parent e7bf58c commit 3632084

File tree

1 file changed

+27
-29
lines changed

1 file changed

+27
-29
lines changed

plotly/tools.py

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2434,7 +2434,7 @@ def create_dendrogram(X, orientation="bottom", labels=None,
24342434
:param (str) orientation: 'top', 'right', 'bottom', or 'left'
24352435
:param (list) labels: List of axis category labels(observation labels)
24362436
:param (list) colorscale: Optional colorscale for dendrogram tree
2437-
clusters
2437+
clusters
24382438
24392439
Example 1: Simple bottom oriented dendrogram
24402440
```
@@ -2457,6 +2457,7 @@ def create_dendrogram(X, orientation="bottom", labels=None,
24572457
24582458
py.iplot(dendro, validate=False, height=1000, width=300)
24592459
```
2460+
24602461
"""
24612462
dependencies = (_scipy_imported and _scipy__spatial_imported and
24622463
_scipy__cluster__hierarchy_imported)
@@ -3204,10 +3205,7 @@ def make_rug(self):
32043205

32053206

32063207
class _Dendrogram(FigureFactory):
3207-
3208-
"""
3209-
Refer to FigureFactory.create_dendrogram() for docstring.
3210-
"""
3208+
"""Refer to FigureFactory.create_dendrogram() for docstring."""
32113209

32123210
def __init__(self, X, orientation='bottom', labels=None, colorscale=None,
32133211
width="100%", height="100%", xaxis='xaxis', yaxis='yaxis'):
@@ -3253,11 +3251,11 @@ def __init__(self, X, orientation='bottom', labels=None, colorscale=None,
32533251

32543252
def get_color_dict(self, colorscale):
32553253
"""
3256-
Returns colorscale used for dendrogram tree clusters
3257-
:param (list) colorscale: colors to use for the plot,
3258-
in rgb format
3259-
:rtype (dict): returns a dictionary of default colors mapped
3260-
to the user colorscale
3254+
Returns colorscale used for dendrogram tree clusters.
3255+
3256+
:param (list) colorscale: Colors to use for the plot in rgb format.
3257+
:rtype (dict): A dict of default colors mapped to the user colorscale.
3258+
32613259
"""
32623260

32633261
# These are the color codes returned for dendrograms
@@ -3292,11 +3290,12 @@ def get_color_dict(self, colorscale):
32923290

32933291
def set_axis_layout(self, axis_key):
32943292
"""
3295-
Sets and returns default axis object for dendrogram figure
3296-
:param (str) axis_key: "xaxis", "xaxis1", "yaxis", yaxis1", etc.
3297-
:rtype (dict): returns an axis_key dictionary with set parameters
3298-
"""
3293+
Sets and returns default axis object for dendrogram figure.
32993294
3295+
:param (str) axis_key: E.g., 'xaxis', 'xaxis1', 'yaxis', yaxis1', etc.
3296+
:rtype (dict): An axis_key dictionary with set parameters.
3297+
3298+
"""
33003299
axis_defaults = {
33013300
'type': 'linear',
33023301
'ticks': 'outside',
@@ -3325,9 +3324,9 @@ def set_axis_layout(self, axis_key):
33253324

33263325
def set_figure_layout(self, width, height):
33273326
"""
3328-
Sets and returns default layout object for dendrogram figure
3329-
"""
3327+
Sets and returns default layout object for dendrogram figure.
33303328
3329+
"""
33313330
self.layout.update({
33323331
'showlegend': False,
33333332
'autoscale': False,
@@ -3343,21 +3342,20 @@ def set_figure_layout(self, width, height):
33433342

33443343
def get_dendrogram_traces(self, X, colorscale):
33453344
"""
3346-
Calculates all the elements needed for plotting a dendrogram
3345+
Calculates all the elements needed for plotting a dendrogram.
33473346
33483347
:param (ndarray) X: Matrix of observations as arrray of arrays
3349-
:param (list) colorscale: Optional colorscale for dendrogram tree
3350-
clusters
3351-
3352-
:rtype (tuple): Contains all the traces in the following order
3353-
(a) trace_list: List of Plotly trace objects for the dendrogram tree
3354-
(b) icoord: All X points of the dendogram tree as array of arrays
3355-
with length 4
3356-
(c) dcoord: All Y points of the dendogram tree as array of arrays
3357-
with length 4
3358-
(d) ordered_labels: leaf labels in the order they are going to
3359-
appear on the plot
3360-
(e) P['leaves']: left-to-right traversal of the leaves
3348+
:param (list) colorscale: Colorscale for dendrogram tree clusters
3349+
:rtype (tuple): Contains all the traces in the following order:
3350+
(a) trace_list: List of Plotly trace objects for dendrogram tree
3351+
(b) icoord: All X points of the dendogram tree as array of arrays
3352+
with length 4
3353+
(c) dcoord: All Y points of the dendogram tree as array of arrays
3354+
with length 4
3355+
(d) ordered_labels: leaf labels in the order they are going to
3356+
appear on the plot
3357+
(e) P['leaves']: left-to-right traversal of the leaves
3358+
33613359
"""
33623360
# TODO: protected until #282
33633361
from plotly.graph_objs import graph_objs

0 commit comments

Comments
 (0)