graphinglib.Table#
- class graphinglib.Table(cell_text: list[str], cell_colors: ArrayLike | str = 'default', cell_align: str = 'default', col_labels: list[str] | None = None, col_widths: list[float] | None = None, col_align: str = 'default', col_colors: ArrayLike | str = 'default', row_labels: list[str] | None = None, row_align: str = 'default', row_colors: ArrayLike | str = 'default', edge_width: float | Literal['default'] = 'default', edge_color: str = 'default', text_color: str = 'default', 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_style
configuration.- cell_alignstr
Alignment of the cells’ text. Must be one of the following: {‘left’, ‘center’, ‘right’}. Default depends on the
figure_style
configuration.- 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_style
configuration.- 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_style
configuration.- 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_style
configuration.- 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_style
configuration.- edge_widthfloat or str, optional
Width of the table’s edges. Default depends on the
figure_style
configuration.- edge_colorstr, optional
Color of the table’s edges. Default depends on the
figure_style
configuration.- text_colorstr, optional
Color of the text in the table. Default depends on the
figure_style
configuration.- 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. Must be one of the following: {‘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’, ‘upper right’} Defaults to
"best"
.
Methods