From 0c6193686fe8f966986ea36e15657ab13464e9e5 Mon Sep 17 00:00:00 2001 From: Claudio Satriano Date: Thu, 20 Jun 2024 07:16:55 +0200 Subject: [PATCH] Log the name of the Matplotlib colormap used for the plot --- requake/plot/plot_utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/requake/plot/plot_utils.py b/requake/plot/plot_utils.py index 62cd4ff..a72a984 100644 --- a/requake/plot/plot_utils.py +++ b/requake/plot/plot_utils.py @@ -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): @@ -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