Skip to content

Commit

Permalink
Fix computation of dynamic ratio colorbar min/max values
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yantosca committed Oct 8, 2024
1 parent 2bb5adc commit 572b083
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions gcpy/plot/six_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 572b083

Please sign in to comment.