From 279d8d6a30b32042b706a32ab509cae31f4449b6 Mon Sep 17 00:00:00 2001 From: Al-Ekram Elahee Hridoy Date: Sat, 7 Oct 2023 07:56:46 -0600 Subject: [PATCH] Check for tight_layout before applying it in plot function (#2504) --- python/prophet/plot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/prophet/plot.py b/python/prophet/plot.py index 3bc1327..f6e618a 100644 --- a/python/prophet/plot.py +++ b/python/prophet/plot.py @@ -63,6 +63,7 @@ def plot( ------- A matplotlib figure. """ + user_provided_ax = False if ax is None else True if ax is None: fig = plt.figure(facecolor='w', figsize=figsize) ax = fig.add_subplot(111) @@ -89,7 +90,8 @@ def plot( ax.set_ylabel(ylabel) if include_legend: ax.legend() - fig.tight_layout() + if not user_provided_ax: + fig.tight_layout() return fig