iode.ComputedTable.plot

ComputedTable.plot(title: str = None, plot_type: str | TableGraphType = TableGraphType.LINE, grid: str | TableGraphGrid = TableGraphGrid.MAJOR, y_log=False, y_min: float = None, y_max: float = None, legend: bool = True, show: bool = True)[source]

Plot the computed table.

Parameters:
titlestr, optional

The title of the plot. If not provided, no title is set.

plot_typestr or TableGraphType, optional

The type of plot to create. Options are ‘line’, ‘scatter’, or ‘bar’. Default is ‘line’.

gridstr or TableGraphGrid, optional

The type of grid to use in the plot. Options are ‘none’, ‘minor’, or ‘major’. Default is ‘major’.

y_logbool, optional

If True, the Y-axis will be set to a logarithmic scale. Default is False.

y_minfloat, optional

The minimum value for the Y-axis. If None, the Y-axis will adapt to the data.

y_maxfloat, optional

The maximum value for the Y-axis. If None, the Y-axis will adapt to the data.

legendbool, optional

If True, a legend will be displayed on the plot. Default is True.

showbool, optional

If True, the plot will be displayed immediately. If False, the plot will not be shown until plt.show() is called. Default is True.

Returns:
ax: matplotlib.axes.Axes

The matplotlib figure containing the plot of the computed table.

Examples

>>> from iode import SAMPLE_DATA_DIR
>>> from iode import Table, tables, variables
>>> tables.load(f"{SAMPLE_DATA_DIR}/fun.tbl")
Loading .../fun.tbl
46 objects loaded 
>>> variables.load(f"{SAMPLE_DATA_DIR}/fun.var")
Loading .../fun.var
394 objects loaded
>>> # simple time series (current workspace) - 6 observations
>>> computed_table = tables["C8_1"].compute("2000:6")
>>> ax = computed_table.plot()