1- from typing import TYPE_CHECKING
1+ from typing import TYPE_CHECKING , Optional
22
33import numpy as np
44
1616
1717if TYPE_CHECKING :
1818 from matplotlib .axes import Axes
19+ from matplotlib .figure import Figure
1920
2021
2122class HistPlot (LinePlot ):
@@ -181,6 +182,7 @@ def _grouped_plot(
181182 column = None ,
182183 by = None ,
183184 numeric_only = True ,
185+ figure : Optional ["Figure" ] = None ,
184186 figsize = None ,
185187 sharex = True ,
186188 sharey = True ,
@@ -203,7 +205,13 @@ def _grouped_plot(
203205
204206 naxes = len (grouped )
205207 fig , axes = create_subplots (
206- naxes = naxes , figsize = figsize , sharex = sharex , sharey = sharey , ax = ax , layout = layout
208+ naxes = naxes ,
209+ figure = figure ,
210+ figsize = figsize ,
211+ sharex = sharex ,
212+ sharey = sharey ,
213+ ax = ax ,
214+ layout = layout ,
207215 )
208216
209217 _axes = flatten_axes (axes )
@@ -222,6 +230,7 @@ def _grouped_hist(
222230 data ,
223231 column = None ,
224232 by = None ,
233+ figure = None ,
225234 ax = None ,
226235 bins = 50 ,
227236 figsize = None ,
@@ -245,6 +254,7 @@ def _grouped_hist(
245254 data : Series/DataFrame
246255 column : object, optional
247256 by : object, optional
257+ figure: figure, optional
248258 ax : axes, optional
249259 bins : int, default 50
250260 figsize : tuple, optional
@@ -282,6 +292,7 @@ def plot_group(group, ax):
282292 data ,
283293 column = column ,
284294 by = by ,
295+ figure = figure ,
285296 sharex = sharex ,
286297 sharey = sharey ,
287298 ax = ax ,
@@ -381,6 +392,7 @@ def hist_frame(
381392 xrot = None ,
382393 ylabelsize = None ,
383394 yrot = None ,
395+ figure = None ,
384396 ax = None ,
385397 sharex = False ,
386398 sharey = False ,
@@ -397,6 +409,7 @@ def hist_frame(
397409 data ,
398410 column = column ,
399411 by = by ,
412+ figure = figure ,
400413 ax = ax ,
401414 grid = grid ,
402415 figsize = figsize ,
@@ -430,6 +443,7 @@ def hist_frame(
430443
431444 fig , axes = create_subplots (
432445 naxes = naxes ,
446+ figure = figure ,
433447 ax = ax ,
434448 squeeze = False ,
435449 sharex = sharex ,
0 commit comments