Skip to content

Commit

Permalink
when a number is provided in show it will clear that figure
Browse files Browse the repository at this point in the history
  • Loading branch information
fkgruber committed Jun 16, 2024
1 parent 4adc2d3 commit 05975dc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions plotnine/facets/facet.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ def _make_figure(self, num = None) -> tuple[Figure, GridSpec]:
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
if num is not None:
plt.figure(num).clear()
return plt.figure(num=num), GridSpec(self.nrow, self.ncol)
else:
return plt.figure(), GridSpec(self.nrow, self.ncol)
Expand Down

0 comments on commit 05975dc

Please sign in to comment.