Skip to content

Commit

Permalink
warning if illegal plot keys are used
Browse files Browse the repository at this point in the history
  • Loading branch information
coxipi committed Jun 13, 2024
1 parent b9417de commit f9a368a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/figanos/matplotlib/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,14 @@ def draw_heatmap(*args, **kwargs):
plot_kw_fg = {
k: v for k, v in plot_kw.items() if k in signature(sns.FacetGrid).parameters
}
unused_keys = (
set(plot_kw.keys()) - set(plot_kw_fg.keys()) - set(plot_kw_hm.keys())
)
if unused_keys != set():
warnings.warn(
f"`plot_kw` containted extra keywords: {unused_keys} that can't be used with `sns.heatmap` or `sns.FacetGrid`. "
"These keywords will be ignored"
)

g = sns.FacetGrid(df, **plot_kw_fg)
cax = g.fig.add_axes([0.92, 0.12, 0.02, 0.8])
Expand Down

0 comments on commit f9a368a

Please sign in to comment.