diff --git a/sktime/utils/plotting.py b/sktime/utils/plotting.py index 1df2c8e0041..b96e50b07a9 100644 --- a/sktime/utils/plotting.py +++ b/sktime/utils/plotting.py @@ -23,6 +23,7 @@ def plot_series( labels=None, markers=None, colors=None, + title=None, x_label=None, y_label=None, ax=None, @@ -41,6 +42,8 @@ def plot_series( The length of the list has to match with the number of series. colors: list, default = None The colors to use for plotting each series. Must contain one color per series + title: str, default = None + The text to use as the figure's suptitle pred_interval: pd.DataFrame, default = None Output of `forecaster.predict_interval()`. Contains columns for lower and upper boundaries of confidence interval. @@ -138,6 +141,10 @@ def format_fn(tick_val, tick_pos): ax.xaxis.set_major_formatter(FuncFormatter(format_fn)) ax.xaxis.set_major_locator(MaxNLocator(integer=True)) + # Set the figure's title + if title is not None: + fig.suptitle(title, size="xx-large") + # Label the x and y axes if x_label is not None: ax.set_xlabel(x_label)