@@ -57,6 +57,11 @@ def plot_rp_intensity(
5757 axis to use
5858 kwargs_local_exceedance_intensity: dict
5959 Dictionary of keyword arguments for the method hazard.local_exceedance_intensity.
60+ mask_rel_distance: float, optional
61+ Relative distance (with respect to maximal map extent in longitude or latitude) to data
62+ points above which plot should not display values. For instance, to only plot values
63+ at the centroids, use mask_rel_distance=0.01. If None, the plot is not masked.
64+ Default is None.
6065 kwargs: optional
6166 arguments for pcolormesh matplotlib function used in event plots
6267
@@ -130,6 +135,11 @@ def plot_intensity(
130135 in module `climada.util.plot`)
131136 axis: matplotlib.axes._subplots.AxesSubplot, optional
132137 axis to use
138+ mask_rel_distance: float, optional
139+ Relative distance (with respect to maximal map extent in longitude or latitude) to data
140+ points above which plot should not display values. For instance, to only plot values
141+ at the centroids, use mask_rel_distance=0.01. If None, the plot is not masked.
142+ Default is None.
133143 kwargs: optional
134144 arguments for pcolormesh matplotlib function
135145 used in event plots or for plot function used in centroids plots
@@ -165,7 +175,15 @@ def plot_intensity(
165175
166176 raise ValueError ("Provide one event id or one centroid id." )
167177
168- def plot_fraction (self , event = None , centr = None , smooth = True , axis = None , ** kwargs ):
178+ def plot_fraction (
179+ self ,
180+ event = None ,
181+ centr = None ,
182+ smooth = True ,
183+ axis = None ,
184+ mask_rel_distance = None ,
185+ ** kwargs ,
186+ ):
169187 """Plot fraction values for a selected event or centroid.
170188
171189 Parameters
@@ -187,6 +205,11 @@ def plot_fraction(self, event=None, centr=None, smooth=True, axis=None, **kwargs
187205 in module `climada.util.plot`)
188206 axis: matplotlib.axes._subplots.AxesSubplot, optional
189207 axis to use
208+ mask_rel_distance: float, optional
209+ Relative distance (with respect to maximal map extent in longitude or latitude) to data
210+ points above which plot should not display values. For instance, to only plot values
211+ at the centroids, use mask_rel_distance=0.01. If None, the plot is not masked.
212+ Default is None.
190213 kwargs: optional
191214 arguments for pcolormesh matplotlib function
192215 used in event plots or for plot function used in centroids plots
@@ -204,7 +227,13 @@ def plot_fraction(self, event=None, centr=None, smooth=True, axis=None, **kwargs
204227 if isinstance (event , str ):
205228 event = self .get_event_id (event )
206229 return self ._event_plot (
207- event , self .fraction , col_label , smooth , axis , ** kwargs
230+ event ,
231+ self .fraction ,
232+ col_label ,
233+ smooth ,
234+ axis ,
235+ mask_rel_distance = mask_rel_distance ,
236+ ** kwargs ,
208237 )
209238 if centr is not None :
210239 if isinstance (centr , tuple ):
@@ -245,6 +274,11 @@ def _event_plot(
245274 axis to use
246275 figsize: tuple, optional
247276 figure size for plt.subplots
277+ mask_rel_distance: float, optional
278+ Relative distance (with respect to maximal map extent in longitude or latitude) to data
279+ points above which plot should not display values. For instance, to only plot values
280+ at the centroids, use mask_rel_distance=0.01. If None, the plot is not masked.
281+ Default is None.
248282 kwargs: optional
249283 arguments for pcolormesh matplotlib function
250284
0 commit comments