MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / table

Function table

lib/matplotlib/table.py:658–859  ·  view source on GitHub ↗

Add a table to an `~.axes.Axes`. .. note:: ``table()`` has some fundamental design limitations and will not be developed further. If you need more functionality, consider `blume `__. At least one of *cellText* or *cellColours*

(ax,
          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',
          **kwargs)

Source from the content-addressed store, hash-verified

656
657@_docstring.interpd
658def table(ax,
659 cellText=None, cellColours=None,
660 cellLoc='right', colWidths=None,
661 rowLabels=None, rowColours=None, rowLoc='left',
662 colLabels=None, colColours=None, colLoc='center',
663 loc='bottom', bbox=None, edges='closed',
664 **kwargs):
665 """
666 Add a table to an `~.axes.Axes`.
667
668 .. note::
669
670 ``table()`` has some fundamental design limitations and will not be
671 developed further. If you need more functionality, consider
672 `blume <https://github.com/swfiua/blume>`__.
673
674 At least one of *cellText* or *cellColours* must be specified. These
675 parameters must be 2D lists, in which the outer lists define the rows and
676 the inner list define the column values per row. Each row must have the
677 same number of elements.
678
679 The table can optionally have row and column headers, which are configured
680 using *rowLabels*, *rowColours*, *rowLoc* and *colLabels*, *colColours*,
681 *colLoc* respectively.
682
683 For finer grained control over tables, use the `.Table` class and add it to
684 the Axes with `.Axes.add_table`.
685
686 Parameters
687 ----------
688 cellText : 2D list of str or pandas.DataFrame, optional
689 The texts to place into the table cells.
690
691 *Note*: Line breaks in the strings are currently not accounted for and
692 will result in the text exceeding the cell boundaries.
693
694 cellColours : 2D list of :mpltype:`color`, optional
695 The background colors of the cells.
696
697 cellLoc : {'right', 'center', 'left'}
698 The alignment of the text within the cells.
699
700 colWidths : list of float, optional
701 The column widths in units of the axes. If not given, all columns will
702 have a width of *1 / ncols*.
703
704 rowLabels : list of str, optional
705 The text of the row header cells.
706
707 rowColours : list of :mpltype:`color`, optional
708 The colors of the row header cells.
709
710 rowLoc : {'left', 'center', 'right'}
711 The text alignment of the row header cells.
712
713 colLabels : list of str, optional
714 The text of the column header cells.
715

Callers

nothing calls this directly

Calls 7

_approx_text_heightMethod · 0.95
add_cellMethod · 0.95
auto_set_column_widthMethod · 0.95
set_fontsizeMethod · 0.95
_is_pandas_dataframeFunction · 0.85
TableClass · 0.85
add_tableMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…