diff --git a/lib/matplotlib/table.py b/lib/matplotlib/table.py index 0556511d5d9e..74af3ca82577 100644 --- a/lib/matplotlib/table.py +++ b/lib/matplotlib/table.py @@ -409,7 +409,27 @@ def _do_cell_alignment(self): cell.set_y(bottoms[row]) def auto_set_column_width(self, col): - + """ Given column indexs in either List, Tuple or int. Will be able to + automatically set the columns into optimal sizes. + + Here is the example of the input, which triger automatic adjustment on + columns to optimal size by given index numbers. + -1: the row labling + 0: the 1st column + 1: the 2nd column + + Args: + col(List): list of indexs + >>>table.auto_set_column_width([-1,0,1]) + + col(Tuple): tuple of indexs + >>>table.auto_set_column_width((-1,0,1)) + + col(int): index integer + >>>table.auto_set_column_width(-1) + >>>table.auto_set_column_width(0) + >>>table.auto_set_column_width(1) + """ # check for col possibility on iteration try: iter(col)