rxnfit.plot_results module — rxnfit 20260314 documentation

# rxnfit.plot_results module

Plot time-course results of ODE solutions.

This module provides plotting functions for reaction kinetics simulation results. Used by RxnODEsolver.solution_plot() and ExpDataFitSci.plot_fitted_solution(), and can be used directly by other features (e.g. sensitivity analysis, uncertainty visualization).

rxnfit.plot_results.plot_time_course_solutions(solution_list: List[Any], df_list: List[DataFrame | None], function_names: List[str], species: List[str] | None = None, subplot_layout: Tuple[int, int] | None = None, dataset_labels: List[str] | None = None, show: bool = True) → Tuple[Any | None, Any | None]

  Plot time-course solutions with optional experimental overlay.

  Draws one subplot per (solution, DataFrame) pair. Simulation curves and optional scatter points from DataFrames are shown. Optionally prints final concentrations.

  Parameters:

    - solution_list – List of OdeResult or None. Length must match df_list when df_list is non-empty. When df_list is empty, uses solution_list as-is. None entries are skipped with a warning.

    - df_list – List of DataFrames for experimental overlay. Can be empty (curves only). When non-empty, len must equal len(solution_list).

    - function_names – List of species names in ODE order.

    - species – Optional list of species to plot. If None, all species.

    - subplot_layout – Optional (n_rows, n_cols). Default (n_plots, 1).

    - dataset_labels – Optional list of labels for each subplot title. If None or not provided for an index, uses “Dataset {idx + 1}”. Length should match the number of plotted datasets.

    - show – If True, call plt.show() before returning. Default True.

  Returns:

    The figure and axes array. Returns (None, None) if there are no successful integrations to plot.

  Return type:

    Tuple (fig, axes)

  Raises:

    ValueError – If species names are invalid or list lengths mismatch.