Skip to content

Commit

Permalink
used importlib.resources to load the matplotlibrc
Browse files Browse the repository at this point in the history
  • Loading branch information
cosimoNigro committed Jan 31, 2022
1 parent cbba76c commit 6abdf22
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions agnpy/utils/plot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# plotting utilities for agnpy
import numpy as np
from pathlib import Path
import importlib.resources
import matplotlib.pyplot as plt

# axes labels
Expand All @@ -10,8 +10,8 @@

def load_mpl_rc():
"""use the custom matplotlibrc in this subdirectory"""
mpl_rc = Path(__file__).parent
plt.style.use(mpl_rc / "matplotlibrc")
with importlib.resources.path("agnpy.utils", "matplotlibrc") as mpl_rc:
plt.style.use(mpl_rc)


def plot_eed(gamma, n_e, gamma_power=0, ax=None, **kwargs):
Expand Down

0 comments on commit 6abdf22

Please sign in to comment.