From 5592d25f68939767c1580241cbf4e7fa6040364e Mon Sep 17 00:00:00 2001 From: Roman Shapovalov Date: Wed, 14 Jun 2023 08:48:14 -0700 Subject: [PATCH] Fix: changed deprecated matplotlib parameter Summary: The parameter was renamed in MPL 3.5.0 in 2021, and the deprecated version is no longer supported. https://matplotlib.org/stable/api/prev_api_changes/api_changes_3.5.0.html#the-first-parameter-of-axes-grid-and-axis-grid-has-been-renamed-to-visible Reviewed By: bottler Differential Revision: D46724242 fbshipit-source-id: 04e2ab6d63369d939ea4f0ce7d64693e0b95ee91 --- pytorch3d/implicitron/tools/stats.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pytorch3d/implicitron/tools/stats.py b/pytorch3d/implicitron/tools/stats.py index 32e7d703..a2d473e2 100644 --- a/pytorch3d/implicitron/tools/stats.py +++ b/pytorch3d/implicitron/tools/stats.py @@ -434,12 +434,9 @@ class Stats(object): plt.gca().yaxis.label.set_color(c[0:3] * 0.75) plt.legend(tmodes) gcolor = np.array(mcolors.to_rgba("lightgray")) - plt.grid( - b=True, which="major", color=gcolor, linestyle="-", linewidth=0.4 - ) - plt.grid( - b=True, which="minor", color=gcolor, linestyle="--", linewidth=0.2 - ) + grid_params = {"visible": True, "color": gcolor} + plt.grid(**grid_params, which="major", linestyle="-", linewidth=0.4) + plt.grid(**grid_params, which="minor", linestyle="--", linewidth=0.2) plt.minorticks_on() plt.tight_layout()