Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented clim in plot_maps_dashboard() function #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion rime/rime_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,9 @@ def plot_maps_dashboard(
Continuous colormap from matplotlib.pyplot. The default is 'magma_r'.
shared_axes : boolean, optional
Whether zoom control automatically controls all axes. The default is True.
clim : # not implemented yet!
clim : list, optional
A list specifying the min and max value to be used for the plots. If not specified, min and max
values are calculated from the input data.
coastline : boolean, optional
Show the coastlines on the map using Cartopy features. The default is True.
crs : str, cartopy.Proj or pyproj.CRS, optional
Expand Down Expand Up @@ -859,6 +861,10 @@ def plot_maps_dashboard(
import cartopy
except:
print("Error importing Cartopy")

# Set min and max for colour maps
clim_min = ds.where(ds != 999.0).to_array('scenario').min().round() if not clim else clim[0]
clim_max = ds.where(ds != 999.0).to_array('scenario').max().round() if not clim else clim[1]

plot_list = []

Expand All @@ -874,6 +880,7 @@ def plot_maps_dashboard(
coastline=coastline,
crs=crs,
features=features,
clim=(clim_min, clim_max),
# check / add clim or vmin/vmax here
)
plot_list = plot_list + [new_plot]
Expand Down
Loading