graphinglib.Table#
- class graphinglib.Table(cell_text: list[str], cell_colors: str | TypeAliasForwardRef('ArrayLike') | Inherit = Inherit, cell_align: str | Inherit = Inherit, col_labels: list[str] | None = None, col_widths: list[float] | None = None, col_align: str | Inherit = Inherit, col_colors: str | TypeAliasForwardRef('ArrayLike') | Inherit = Inherit, row_labels: list[str] | None = None, row_align: str | Inherit = Inherit, row_colors: str | TypeAliasForwardRef('ArrayLike') | Inherit = Inherit, edge_width: float | Inherit = Inherit, edge_color: str | Inherit = Inherit, text_color: str | Inherit = Inherit, scaling: tuple[float, float] = (1.0, 1.5), location: str = 'best')[source]#
This class allows to plot a table inside a Figure or MultiFigure.
The Table object can be used to add raw data to a figure or add supplementary information like output parameters for a fit or anyother operation.
- Parameters:
- cell_textlist[str]
Text or data to be displayed in the table. The shape of the provided data determines the number of columns and rows.
- cell_colorsArrayLike or str, optional
Colors to apply to the cells’ background. Must be a list of colors the same shape as the cells. Default depends on the
figure_styleconfiguration.- cell_alignstr
Alignment of the cells’ text. Must be one of the following: {‘left’, ‘center’, ‘right’}. Default depends on the
figure_styleconfiguration.- col_labelslist[str], optional
List of labels for the rows of the table. If none are specified, no row labels are displayed.
- col_widthslist[float], optional
Widths to apply to the columns. Must be a list the same length as the number of columns.
- col_alignstr
Alignment of the column labels’ text. Must be one of the following: {‘left’, ‘center’, ‘right’}. Default depends on the
figure_styleconfiguration.- col_colorsArrayLike or str, optional
Colors to apply to the column labels’ background. Must be a list of colors the same length as the number of columns. Default depends on the
figure_styleconfiguration.- row_labelslist[str], optional
List of labels for the rows of the table. If none are specified, no row labels are displayed.
- row_alignstr
Alignment of the row labels’ text. Must be one of the following: {‘left’, ‘center’, ‘right’}. Default depends on the
figure_styleconfiguration.- row_colorsArrayLike or str, optional
Colors to apply to the row labels’ background. Must be a list of colors the same length as the number of rows. Default depends on the
figure_styleconfiguration.- edge_widthfloat or str, optional
Width of the table’s edges. Typical range is
0.5to3. Default depends on thefigure_styleconfiguration.- edge_colorstr, optional
Color of the table’s edges. Default depends on the
figure_styleconfiguration.- text_colorstr, optional
Color of the text in the table. Default depends on the
figure_styleconfiguration.- scalingtuple[float], optional
Horizontal and vertical scaling factors to apply to the table. Defaults to
(1, 1.5).- locationstr
Position of the table inside the axes. Values are
"best","bottom","bottom left","bottom right","center","center left","center right","left","lower center","lower left","lower right","right","top","top left","top right","upper center","upper left", and"upper right". Defaults to"best".
Notes
Color parameters accept Matplotlib color formats: named colors (
"blue"), short color strings ("b"), hex strings ("#0000ff"), grayscale strings ("0.5"), and RGB/RGBA tuples with values between0and1((0, 0, 1)or(0, 0, 1, 0.5)).Methods