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

Skip to content

Commit 62d40ab

Browse files
committed
Merge pull request #6123 from ryanbelt/master
DOC: docstring added
2 parents 77813bc + 893bfea commit 62d40ab

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

lib/matplotlib/table.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,27 @@ def _do_cell_alignment(self):
409409
cell.set_y(bottoms[row])
410410

411411
def auto_set_column_width(self, col):
412-
412+
""" Given column indexs in either List, Tuple or int. Will be able to
413+
automatically set the columns into optimal sizes.
414+
415+
Here is the example of the input, which triger automatic adjustment on
416+
columns to optimal size by given index numbers.
417+
-1: the row labling
418+
0: the 1st column
419+
1: the 2nd column
420+
421+
Args:
422+
col(List): list of indexs
423+
>>>table.auto_set_column_width([-1,0,1])
424+
425+
col(Tuple): tuple of indexs
426+
>>>table.auto_set_column_width((-1,0,1))
427+
428+
col(int): index integer
429+
>>>table.auto_set_column_width(-1)
430+
>>>table.auto_set_column_width(0)
431+
>>>table.auto_set_column_width(1)
432+
"""
413433
# check for col possibility on iteration
414434
try:
415435
iter(col)

0 commit comments

Comments
 (0)