This PR adds the function add_theme() to theme.py to save a themes rcParams that differ from the matplotlib default rcParams to themes/theme_name.txt locally.
To do this, this PR also adds the function set_updated_rcparams to theme.py. It iters through the current rcParams, compares them to the default values, and stores the non-default values in theme.updated_params.
This allows us to easily save, share and reuse themes.
I hope this matches the intention you had for this function in the ToDo list, but feel free to correct me if I misunderstood this.
On second thought I wonder whether those functions would better belong in set_theme?
theme = themepy.Theme()
# set a theme with
# theme.set_theme(theme_name)
# set rcParams with
# theme.set_pips().set_spines() etc.
# or with
# mpl.rcParams[param] = value
# When happy with the theme, save it for future use.
theme.add_theme(theme_name)
An example of a saved theme by calling add_theme() looks like this:
This PR adds the function add_theme() to theme.py to save a themes rcParams that differ from the matplotlib default rcParams to themes/theme_name.txt locally.
To do this, this PR also adds the function set_updated_rcparams to theme.py. It iters through the current rcParams, compares them to the default values, and stores the non-default values in theme.updated_params.
This allows us to easily save, share and reuse themes.
I hope this matches the intention you had for this function in the ToDo list, but feel free to correct me if I misunderstood this. On second thought I wonder whether those functions would better belong in set_theme?
An example of a saved theme by calling add_theme() looks like this: