Skip to content

Commit 5ff4ddb

Browse files
change default value of mask parameter and update changelog
1 parent b0547bc commit 5ff4ddb

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Removed:
1616

1717
### Added
1818
- Added optional parameter to `geo_im_from_array`, `plot_from_gdf`, `plot_rp_imp`, `plot_rp_intensity`,
19-
`plot_intensity`, `plot_fraction`, `_event_plot` to mask plotting when regions are too far from data points [#1047](https://github.com/CLIMADA-project/climada_python/pull/1047).
19+
`plot_intensity`, `plot_fraction`, `_event_plot` to mask plotting when regions are too far from data points [#1047](https://github.com/CLIMADA-project/climada_python/pull/1047). To recreate previous plots (no masking), the parameter can be set to None.
2020
- Added instructions to install Climada petals on Euler cluster in `doc.guide.Guide_Euler.ipynb` [#1029](https://github.com/CLIMADA-project/climada_python/pull/1029)
2121

2222
### Changed

climada/engine/impact.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ def plot_rp_imp(
11781178
return_periods=(25, 50, 100, 250),
11791179
log10_scale=True,
11801180
axis=None,
1181-
mask_distance=None,
1181+
mask_distance=0.01,
11821182
kwargs_local_exceedance_impact=None,
11831183
**kwargs,
11841184
):
@@ -1199,7 +1199,7 @@ def plot_rp_imp(
11991199
Only regions are plotted that are closer to any of the data points than this distance,
12001200
relative to overall plot size. For instance, to only plot values
12011201
at the centroids, use mask_distance=0.01. If None, the plot is not masked.
1202-
Default is None.
1202+
Default is 0.01.
12031203
kwargs_local_exceedance_impact: dict
12041204
Dictionary of keyword arguments for the method impact.local_exceedance_impact.
12051205
kwargs : dict, optional

climada/hazard/plot.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def plot_rp_intensity(
4040
self,
4141
return_periods=(25, 50, 100, 250),
4242
axis=None,
43-
mask_distance=None,
43+
mask_distance=0.01,
4444
kwargs_local_exceedance_intensity=None,
4545
**kwargs,
4646
):
@@ -61,7 +61,7 @@ def plot_rp_intensity(
6161
Only regions are plotted that are closer to any of the data points than this distance,
6262
relative to overall plot size. For instance, to only plot values
6363
at the centroids, use mask_distance=0.01. If None, the plot is not masked.
64-
Default is None.
64+
Default is 0.01.
6565
kwargs: optional
6666
arguments for pcolormesh matplotlib function used in event plots
6767
@@ -111,7 +111,7 @@ def plot_intensity(
111111
smooth=True,
112112
axis=None,
113113
adapt_fontsize=True,
114-
mask_distance=None,
114+
mask_distance=0.01,
115115
**kwargs,
116116
):
117117
"""Plot intensity values for a selected event or centroid.
@@ -139,7 +139,7 @@ def plot_intensity(
139139
Only regions are plotted that are closer to any of the data points than this distance,
140140
relative to overall plot size. For instance, to only plot values
141141
at the centroids, use mask_distance=0.01. If None, the plot is not masked.
142-
Default is None.
142+
Default is 0.01.
143143
kwargs: optional
144144
arguments for pcolormesh matplotlib function
145145
used in event plots or for plot function used in centroids plots
@@ -181,7 +181,7 @@ def plot_fraction(
181181
centr=None,
182182
smooth=True,
183183
axis=None,
184-
mask_distance=None,
184+
mask_distance=0.01,
185185
**kwargs,
186186
):
187187
"""Plot fraction values for a selected event or centroid.
@@ -252,7 +252,7 @@ def _event_plot(
252252
axis=None,
253253
figsize=(9, 13),
254254
adapt_fontsize=True,
255-
mask_distance=None,
255+
mask_distance=0.01,
256256
**kwargs,
257257
):
258258
"""Plot an event of the input matrix.

climada/util/plot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def geo_im_from_array(
338338
axes=None,
339339
figsize=(9, 13),
340340
adapt_fontsize=True,
341-
mask_distance=None,
341+
mask_distance=0.01,
342342
**kwargs,
343343
):
344344
"""Image(s) plot defined in array(s) over input coordinates.
@@ -374,7 +374,7 @@ def geo_im_from_array(
374374
Only regions are plotted that are closer to any of the data points than this distance,
375375
relative to overall plot size. For instance, to only plot values
376376
at the centroids, use mask_distance=0.01. If None, the plot is not masked.
377-
Default is None.
377+
Default is 0.01.
378378
**kwargs
379379
arbitrary keyword arguments for pcolormesh matplotlib function
380380
@@ -1104,7 +1104,7 @@ def plot_from_gdf(
11041104
axis=None,
11051105
figsize=(9, 13),
11061106
adapt_fontsize=True,
1107-
mask_distance=None,
1107+
mask_distance=0.01,
11081108
**kwargs,
11091109
):
11101110
"""Plot several subplots from different columns of a GeoDataFrame, e.g., for
@@ -1131,7 +1131,7 @@ def plot_from_gdf(
11311131
Relative distance (with respect to maximal map extent in longitude or latitude) to data
11321132
points above which plot should not display values. For instance, to only plot values
11331133
at the centroids, use mask_distance=0.01. If None, the plot is not masked.
1134-
Default is None.
1134+
Default is 0.01.
11351135
kwargs: optional
11361136
Arguments for pcolormesh matplotlib function used in event plots.
11371137

0 commit comments

Comments
 (0)