Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions python/prophet/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ def plot(
if include_legend:
ax.legend()
if not user_provided_ax:
fig.tight_layout()
try:
if fig.get_layout_engine() is None:
fig.tight_layout()
except AttributeError:
fig.tight_layout()
return fig


Expand Down Expand Up @@ -224,7 +228,11 @@ def plot_components(
if plot_name in m.component_modes['multiplicative']:
multiplicative_axes.append(ax)

fig.tight_layout()
try:
if fig.get_layout_engine() is None:
fig.tight_layout()
except AttributeError:
fig.tight_layout()
# Reset multiplicative axes labels after tight_layout adjustment
for ax in multiplicative_axes:
ax = set_y_as_percent(ax)
Expand Down