Skip to content

Commit

Permalink
mpl style config setting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alphasentaurii committed Apr 2, 2024
1 parent 34cece9 commit a6516c9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
bugfixes
--------

- move HstSvmRadio import inside class method to avoid importing astroquery unnecessarily; temporarily pin tf max version to 2.15 to ensure compatibility with models saved in 2.13 or older [#49]
- move HstSvmRadio import inside class method to avoid importing astroquery unnecessarily [#49]

- temporarily pin tf max version to 2.15 to ensure compatibility with models saved in 2.13 or older

- matplotlib style setting looks for "seaborn-v0_8-bright" if "seaborn-bright" unavailable, fallback uses default style


installation / automation
Expand Down
9 changes: 7 additions & 2 deletions spacekit/analyzer/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@
import plotly.graph_objects as go
import matplotlib as mpl
import matplotlib.pyplot as plt

plt.style.use("seaborn-bright")
font_dict = {"family": "monospace", "size": 16} # Titillium Web
mpl.rc("font", **font_dict)
styles = ["seaborn-bright", "seaborn-v0_8-bright"]
valid_styles = [s for s in styles if s in plt.style.available]
if len(valid_styles) > 0:
try:
plt.style.use(valid_styles[0])
except OSError:
pass
except ImportError:
go = None
mpl = None
Expand Down
9 changes: 7 additions & 2 deletions spacekit/analyzer/explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@
try:
import matplotlib as mpl
import matplotlib.pyplot as plt

plt.style.use("seaborn-bright")
font_dict = {"family": "monospace", "size": 16}
mpl.rc("font", **font_dict)
styles = ["seaborn-bright", "seaborn-v0_8-bright"]
valid_styles = [s for s in styles if s in plt.style.available]
if len(valid_styles) > 0:
try:
plt.style.use(valid_styles[0])
except OSError:
pass
except ImportError:
mpl = None
plt = None
Expand Down

0 comments on commit a6516c9

Please sign in to comment.