@@ -1455,8 +1455,10 @@ def _scatterplot(dataframe, headers,
14551455 height , width ,
14561456 title , ** kwargs ):
14571457 """
1458- Returns fig for scatterplotmatrix without index or theme.
14591458 Refer to FigureFactory.create_scatterplotmatrix() for docstring.
1459+
1460+ Returns fig for scatterplotmatrix without index or theme.
1461+
14601462 """
14611463
14621464 from plotly .graph_objs import graph_objs
@@ -1532,8 +1534,10 @@ def _scatterplot_index(dataframe, headers,
15321534 index , index_vals ,
15331535 ** kwargs ):
15341536 """
1535- Returns fig for scatterplotmatrix with an index and no theme.
15361537 Refer to FigureFactory.create_scatterplotmatrix() for docstring.
1538+
1539+ Returns fig for scatterplotmatrix with an index and no theme.
1540+
15371541 """
15381542 from plotly .graph_objs import graph_objs
15391543 dim = len (dataframe )
@@ -1699,9 +1703,10 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width,
16991703 title , index , index_vals , endpts ,
17001704 palette , ** kwargs ):
17011705 """
1702- Returns fig for scatterplotmatrix with both index and theme.
17031706 Refer to FigureFactory.create_scatterplotmatrix() for docstring.
17041707
1708+ Returns fig for scatterplotmatrix with both index and theme.
1709+
17051710 :raises: (PlotlyError) If palette string is not a Plotly colorscale
17061711 :raises: (PlotlyError) If palette is not a string or list
17071712 """
@@ -2263,7 +2268,7 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width,
22632268 @staticmethod
22642269 def _validate_index (index_vals ):
22652270 """
2266- Validates if a list contains all numbers or all strings.
2271+ Validates if a list contains all numbers or all strings
22672272
22682273 :raises: (PlotlyError) If there are any two items in the list whose
22692274 types differ
@@ -2286,8 +2291,7 @@ def _validate_index(index_vals):
22862291 @staticmethod
22872292 def _validate_dataframe (array ):
22882293 """
2289- Validates if for the lists in a dataframe, they contain all numbers
2290- or all strings.
2294+ Validates all strings or numbers in each dataframe column
22912295
22922296 :raises: (PlotlyError) If there are any two items in any list whose
22932297 types differ
@@ -2357,6 +2361,8 @@ def _validate_scatterplotmatrix(df, index, diag, **kwargs):
23572361 @staticmethod
23582362 def _endpts_to_intervals (endpts ):
23592363 """
2364+ Returns a list of intervals for categorical colormaps
2365+
23602366 Accepts a list or tuple of sequentially increasing numbers and returns
23612367 a list representation of the mathematical intervals with these numbers
23622368 as endpoints. For example, [1, 4, 6] returns [[1, 4], [4, 6]]
@@ -2402,6 +2408,8 @@ def _endpts_to_intervals(endpts):
24022408 @staticmethod
24032409 def _convert_to_RGB_255 (colors ):
24042410 """
2411+ Return a list of tuples where each element gets multiplied by 255
2412+
24052413 Takes a list of color tuples where each element is between 0 and 1
24062414 and returns the same list where each tuple element is normalized to be
24072415 between 0 and 255
@@ -2414,32 +2422,38 @@ def _convert_to_RGB_255(colors):
24142422 return colors_255
24152423
24162424 @staticmethod
2417- def _n_colors (tuple1 , tuple2 , n_colors ):
2425+ def _n_colors (lowcolor , highcolor , n_colors ):
24182426 """
2427+ Splits a low and high color into a list of #n_colors colors
2428+
24192429 Accepts two color tuples and returns a list of n_colors colors
2420- which form the intermediate points between tuple1 and tuple2
2430+ which form the intermediate colors between lowcolor and highcolor
2431+
24212432 """
2422- diff_0 = float (tuple2 [0 ] - tuple1 [0 ])
2433+ diff_0 = float (highcolor [0 ] - lowcolor [0 ])
24232434 incr_0 = diff_0 / (n_colors - 1 )
2424- diff_1 = float (tuple2 [1 ] - tuple1 [1 ])
2435+ diff_1 = float (highcolor [1 ] - lowcolor [1 ])
24252436 incr_1 = diff_1 / (n_colors - 1 )
2426- diff_2 = float (tuple2 [2 ] - tuple1 [2 ])
2437+ diff_2 = float (highcolor [2 ] - lowcolor [2 ])
24272438 incr_2 = diff_2 / (n_colors - 1 )
24282439 color_tuples = []
24292440
24302441 for index in range (n_colors ):
2431- new_tuple = (tuple1 [0 ] + (index * incr_0 ),
2432- tuple1 [1 ] + (index * incr_1 ),
2433- tuple1 [2 ] + (index * incr_2 ))
2442+ new_tuple = (lowcolor [0 ] + (index * incr_0 ),
2443+ lowcolor [1 ] + (index * incr_1 ),
2444+ lowcolor [2 ] + (index * incr_2 ))
24342445 color_tuples .append (new_tuple )
24352446
24362447 return color_tuples
24372448
24382449 @staticmethod
24392450 def _label_rgb (colors ):
24402451 """
2452+ Takes colors (a, b, c) and returns tuples 'rgb(a, b, c)'
2453+
24412454 Takes a list of two color tuples of the form (a, b, c) and returns the
24422455 same list with each tuple replaced by a string 'rgb(a, b, c)'
2456+
24432457 """
24442458 colors_label = []
24452459 for color in colors :
@@ -2451,21 +2465,24 @@ def _label_rgb(colors):
24512465 @staticmethod
24522466 def _unlabel_rgb (colors ):
24532467 """
2468+ Takes rgb colors 'rgb(a, b, c)' and returns the tuples (a, b, c)
2469+
24542470 This function takes a list of two 'rgb(a, b, c)' color strings and
24552471 returns a list of the color tuples in tuple form without the 'rgb'
24562472 label. In particular, the output is a list of two tuples of the form
24572473 (a, b, c)
2474+
24582475 """
24592476 unlabelled_colors = []
2460- for color in colors :
2477+ for character in colors :
24612478 str_vals = ''
2462- for index in range (len (color )):
2479+ for index in range (len (character )):
24632480 try :
2464- float (color [index ])
2465- str_vals = str_vals + color [index ]
2481+ float (character [index ])
2482+ str_vals = str_vals + character [index ]
24662483 except ValueError :
2467- if (color [index ] == ',' ) or (color [index ] == '.' ):
2468- str_vals = str_vals + color [index ]
2484+ if (character [index ] == ',' ) or (character [index ] == '.' ):
2485+ str_vals = str_vals + character [index ]
24692486
24702487 str_vals = str_vals + ','
24712488 numbers = []
0 commit comments