Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions catppuccin/extras/matplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
import matplotlib as mpl
import matplotlib.colors
import matplotlib.style
from matplotlib import rc_params_from_file

from catppuccin.palette import PALETTE

Expand All @@ -84,10 +85,10 @@

def _register_styles() -> None:
"""Register the included stylesheets in the mpl style library."""
catppuccin_stylesheets = mpl.style.core.read_style_directory( # type: ignore [attr-defined]
CATPPUCCIN_STYLE_DIRECTORY
)
mpl.style.core.update_nested_dict(mpl.style.library, catppuccin_stylesheets) # type: ignore [attr-defined]
for path in Path(CATPPUCCIN_STYLE_DIRECTORY).glob(f"*.mplstyle"):
stylename = path.stem
style = rc_params_from_file(path, use_default_template=False)
mpl.style.library.setdefault(stylename, {}).update(style)


def _register_colormap_list() -> None:
Expand Down