@@ -39,35 +39,38 @@ def create_table(
39
39
See also the plotly.graph_objects trace
40
40
:class:`plotly.graph_objects.Table`
41
41
42
- :param (pandas.Dataframe | list[list]) text: data for table.
43
- :param (str|list[list]) colorscale: Colorscale for table where the
44
- color at value 0 is the header color, .5 is the first table color
45
- and 1 is the second table color. (Set .5 and 1 to avoid the striped
46
- table effect). Default=[[0, '#66b2ff'], [.5, '#d9d9d9'],
42
+ Parameters
43
+ ----------
44
+ text : pandas.DataFrame or list of list
45
+ Data for table.
46
+ colorscale : str or list of list
47
+ Colorscale for table where the color at value 0 is the header color, .5 is the first table color
48
+ and 1 is the second table color. (Set .5 and 1 to avoid the striped table effect). Default=[[0, '#66b2ff'], [.5, '#d9d9d9'],
47
49
[1, '#ffffff']]
48
- :param (list) font_colors: Color for fonts in table. Can be a single
49
- color, three colors, or a color for each row in the table.
50
+ font_colors : list
51
+ Color for fonts in table. Can be a single color, three colors, or a color for each row in the table.
50
52
Default=['#000000'] (black text for the entire table)
51
- :param (int) height_constant: Constant multiplied by # of rows to
52
- create table height. Default=30.
53
- :param (bool) index: Create (header-colored) index column index from
54
- Pandas dataframe or list[0] for each list in text. Default=False.
55
- :param (string) index_title: Title for index column. Default=''.
56
- :param kwargs: kwargs passed through plotly.graph_objs.Heatmap.
57
- These kwargs describe other attributes about the annotated Heatmap
58
- trace such as the colorscale. For more information on valid kwargs
59
- call help(plotly.graph_objs.Heatmap)
60
-
53
+ height_constant : int
54
+ Constant multiplied by the number of rows to create table height. Default=30.
55
+ index : bool
56
+ Create (header-colored) index column index from Pandas dataframe or list[0] for each list in text. Default=False.
57
+ index_title : str
58
+ Title for index column. Default=''.
59
+ **kwargs
60
+ Additional keyword arguments passed through to `plotly.graph_objs.Heatmap`.
61
+ These kwargs describe other attributes about the annotated Heatmap trace such as the colorscale.
62
+ For more information on valid kwargs call `help(plotly.graph_objs.Heatmap)`.
63
+
64
+ Examples
65
+ --------
61
66
Example 1: Simple Plotly Table
62
67
63
68
>>> from plotly.figure_factory import create_table
64
-
65
69
>>> text = [['Country', 'Year', 'Population'],
66
70
... ['US', 2000, 282200000],
67
71
... ['Canada', 2000, 27790000],
68
72
... ['US', 2010, 309000000],
69
73
... ['Canada', 2010, 34000000]]
70
-
71
74
>>> table = create_table(text)
72
75
>>> table.show()
73
76
@@ -84,7 +87,7 @@ def create_table(
84
87
... [.5, '#80beff'],
85
88
... [1, '#cce5ff']],
86
89
... font_colors=['#ffffff', '#000000',
87
- ... '#000000'])
90
+ ... '#000000'])
88
91
>>> table.show()
89
92
90
93
Example 3: Simple Plotly Table with Pandas
@@ -95,7 +98,6 @@ def create_table(
95
98
>>> df_p = df[0:25]
96
99
>>> table_simple = create_table(df_p)
97
100
>>> table_simple.show()
98
-
99
101
"""
100
102
101
103
# Avoiding mutables in the call signature
0 commit comments