Skip to content

Commit

Permalink
Log the name of the Matplotlib colormap used for the plot
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiodsf committed Jun 20, 2024
1 parent ee4ebab commit 0c61936
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions requake/plot/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
GNU General Public License v3.0 or later
(https://www.gnu.org/licenses/gpl-3.0-standalone.html)
"""
import logging
import contextlib
import matplotlib.dates as mdates
import numpy as np
from matplotlib import cm, colors
from ..config import config
from .colormaps import cmaps
logger = logging.getLogger(__name__.rsplit('.', maxsplit=1)[-1])


def format_time_axis(ax, which='xaxis', grid=True):
Expand Down Expand Up @@ -203,6 +205,7 @@ def family_colors(families):
colorby = config.args.colorby
try:
cmap = cmaps[colorby]
logger.info(f'Using Matplotlib colormap "{cmap.name}"')
except KeyError as e:
raise ValueError(f'Invalid value for "colorby": {colorby}') from e
# special cases
Expand Down

0 comments on commit 0c61936

Please sign in to comment.