Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Implementing plot title for plot_series #4038

Merged
merged 3 commits into from Jan 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions sktime/utils/plotting.py
Expand Up @@ -23,6 +23,7 @@ def plot_series(
labels=None,
markers=None,
colors=None,
title=None,
x_label=None,
y_label=None,
ax=None,
Expand All @@ -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.
Expand Down Expand Up @@ -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)
Expand Down