Skip to content

Commit

Permalink
ensure global fig kws are not modified in funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssadai committed Jun 6, 2024
1 parent cf4a027 commit cb74921
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions climate_emotions_map/make_stacked_bar_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,8 @@ def make_stacked_bar(
fig_kw : dict, optional
A dictionary of figure parameters. The default is None.
"""
if fig_kw is None:
# We need to make a deep copy to avoid modifying the default values!
fig_kw = copy.deepcopy(DEFAULT_FIG_KW)
# We need to make a deep copy to avoid modifying the global figure parameters
fig_kw = copy.deepcopy(DEFAULT_FIG_KW if fig_kw is None else fig_kw)

if palettes is None:
palettes = PALETTES_BY_LENGTH
Expand Down

0 comments on commit cb74921

Please sign in to comment.