Skip to content

Commit

Permalink
title as parameter for TimeSeries.plot()
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathankoch99 committed Jan 8, 2025
1 parent b441192 commit a48f118
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion darts/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -4077,6 +4077,7 @@ def plot(
low_quantile: Optional[float] = 0.05,
high_quantile: Optional[float] = 0.95,
default_formatting: bool = True,
title: Optional[str] = None,
label: Optional[Union[str, Sequence[str]]] = "",
max_nr_components: int = 10,
ax: Optional[matplotlib.axes.Axes] = None,
Expand Down Expand Up @@ -4106,6 +4107,8 @@ def plot(
interval is shown if `high_quantile` is None (default 0.95).
default_formatting
Whether to use the darts default scheme.
title
The title of the plot.
label
Can either be a string or list of strings. If a string and the series only has a single component, it is
used as the label for that component. If a string and the series has multiple components, it is used as
Expand Down Expand Up @@ -4254,7 +4257,7 @@ def plot(
)

ax.legend()
ax.set_title(self._xa.name)
ax.set_title(title if title else self._xa.name)
return ax

def with_columns_renamed(
Expand Down

0 comments on commit a48f118

Please sign in to comment.