Skip to content

Commit

Permalink
Merge pull request #14 from AusClimateService/cmap_arrows_13
Browse files Browse the repository at this point in the history
add extend keyword to boundaryNorm. fixes #13
  • Loading branch information
xenct authored Jul 11, 2024
2 parents de50455 + 3c36b1e commit df8992a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions acs_plotting_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def plot_acs_hazard(
# if ticks are labelled or if there is one more tick than tick labels,
# do the usual normalisation
if tick_labels is None or (len(tick_labels) == len(ticks) - 1):
norm = BoundaryNorm(ticks, cmap.N)
norm = BoundaryNorm(ticks, cmap.N, extend = cbar_extend)
if tick_labels is not None:
middle_ticks = [
(ticks[i + 1] + ticks[i]) / 2 for i in range(len(ticks) - 1)
Expand All @@ -455,7 +455,7 @@ def plot_acs_hazard(
outside_bound_first = [ticks[0] - (ticks[1] - ticks[0]) / 2]
outside_bound_last = [ticks[-1] + (ticks[-1] - ticks[-2]) / 2]
bounds = outside_bound_first + middle_ticks + outside_bound_last
norm = BoundaryNorm(bounds, cmap.N)
norm = BoundaryNorm(bounds, cmap.N, extend = cbar_extend)

# plot the hazard data
if contourf and tick_labels is None:
Expand Down

0 comments on commit df8992a

Please sign in to comment.