matplotlib.table
¶Place a table below the x-axis at location loc.
The table consists of a grid of cells.
The grid need not be rectangular and can have holes.
Cells are added by specifying their row and column.
For the purposes of positioning the cell at (0, 0) is assumed to be at the top left and the cell at (max_row, max_col) is assumed to be at bottom right.
You can add additional cells outside this range to have convenient ways of positioning more interesting grids.
Author : John Gill <jng@europe.renre.com> Copyright : 2004 John Gill and John Hunter License : matplotlib license
matplotlib.table.
Cell
(xy, width, height, edgecolor='k', facecolor='w', fill=True, text='', loc=None, fontproperties=None)[source]¶Bases: matplotlib.patches.Rectangle
A cell is a Rectangle with some associated text.
PAD
= 0.1¶matplotlib.table.
CustomCell
(*args, **kwargs)[source]¶Bases: matplotlib.table.Cell
A subclass of Cell where the sides may be visibly toggled.
visible_edges
¶matplotlib.table.
Table
(ax, loc=None, bbox=None, **kwargs)[source]¶Bases: matplotlib.artist.Artist
Create a table of cells.
Table can have (optional) row and column headers.
Each entry in the table can be either text or patches.
Column widths and row heights for the table can be specified.
Return value is a sequence of text, line and patch instances that make up the table
AXESPAD
= 0.02¶FONTSIZE
= 10¶add_cell
(row, col, *args, **kwargs)[source]¶Add a cell to the table.
Parameters: |
|
---|---|
Returns: |
|
auto_set_column_width
(col)[source]¶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
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)
codes
= {'best': 0, 'bottom': 17, 'bottom left': 12, 'bottom right': 13, 'center': 9, 'center left': 5, 'center right': 6, 'left': 15, 'lower center': 7, 'lower left': 3, 'lower right': 4, 'right': 14, 'top': 16, 'top left': 11, 'top right': 10, 'upper center': 8, 'upper left': 2, 'upper right': 1}¶edges
¶get_child_artists
()¶Return the Artists contained by the table
matplotlib.table.
table
(cellText=None, cellColours=None, cellLoc='right', colWidths=None, rowLabels=None, rowColours=None, rowLoc='left', colLabels=None, colColours=None, colLoc='center', loc='bottom', bbox=None, edges='closed')[source]¶Factory function to generate a Table instance.
Thanks to John Gill for providing the class and table.