From 572b083feeaad1d682e9dccc3295f7b58f2ad7f7 Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Tue, 8 Oct 2024 10:55:19 -0400 Subject: [PATCH] Fix computation of dynamic ratio colorbar min/max values gcpy/plot/six_plot.py - Now set vmin as the min of the absolute values of the min and max of the plot_val array and set vmax as 1/vmin. - This should prevent the colorbar from being set to a too-narrow range. CHANGELOG.md - Updated accordingly. --- CHANGELOG.md | 1 + gcpy/plot/six_plot.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4649c521..e48193bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Fixed - Fixed formatting error in `.github/workflows/stale.yml` that caused the Mark Stale Issues action not to run - Now flag differences greater than +/- 10% in benchmark timing table outputs +- Fixed error in computation of dynamic ratio plot min & max values in `plot/six_plot.py` ### Removed - Removed `gcpy/benchmark/modules/species_database.yml` file and corresponding code pointing to this diff --git a/gcpy/plot/six_plot.py b/gcpy/plot/six_plot.py index b4db49aa..fea865b0 100644 --- a/gcpy/plot/six_plot.py +++ b/gcpy/plot/six_plot.py @@ -544,10 +544,10 @@ def vmin_vmax_for_ratio_plots( """ # Ratio (dynamic range) subplot) if subplot in "dyn_ratio": - vmax = np.max( + vmin = np.min( [np.abs(np.nanmin(plot_val)), np.abs(np.nanmax(plot_val))] ) - vmin = 1.0 / vmax + vmax = 1.0 / vmin if vmin > vmax: vmin, vmax = vmax, vmin verbose_print(verbose, rowcol, vmin, vmax)