diff --git a/AUTHORS.md b/AUTHORS.md index d5fe7f2390..a45b407f71 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -29,3 +29,4 @@ * Raphael Portmann * Nicolas Colombi * Leonie Villiger +* Kam Lam Yeung diff --git a/CHANGELOG.md b/CHANGELOG.md index 212cf96388..7e657dccf7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Code freeze date: YYYY-MM-DD ### Changed +- Add `shapes` argument to `geo_im_from_array` to allow flexible turning on/off of plotting coastline in `plot_intensity`. [#805](https://github.com/CLIMADA-project/climada_python/pull/805) - Update `CONTRIBUTING.md` to better explain types of contributions to this repository [#797](https://github.com/CLIMADA-project/climada_python/pull/797) - The default tile layer in Exposures maps is not Stamen Terrain anymore, but [CartoDB Positron](https://github.com/CartoDB/basemap-styles). Affected methods are `climada.engine.Impact.plot_basemap_eai_exposure`,`climada.engine.Impact.plot_basemap_impact_exposure` and `climada.entity.Exposures.plot_basemap`. [#798](https://github.com/CLIMADA-project/climada_python/pull/798) diff --git a/climada/util/plot.py b/climada/util/plot.py index b35569f28b..6573d4793f 100644 --- a/climada/util/plot.py +++ b/climada/util/plot.py @@ -251,7 +251,7 @@ def _plot_scattered_data(method, array_sub, geo_coord, var_name, title, def geo_im_from_array(array_sub, coord, var_name, title, - proj=None, smooth=True, axes=None, figsize=(9, 13), adapt_fontsize=True, + proj=None, smooth=True, shapes=True, axes=None, figsize=(9, 13), adapt_fontsize=True, **kwargs): """Image(s) plot defined in array(s) over input coordinates. @@ -272,6 +272,9 @@ def geo_im_from_array(array_sub, coord, var_name, title, coordinate reference system used in coordinates, by default None smooth : bool, optional smooth plot to RESOLUTIONxRESOLUTION, by default True + shapes : bool, optional + Overlay Earth's countries coastlines to matplotlib.pyplot axis. + The default is True axes : Axes or ndarray(Axes), optional by default None figsize : tuple, optional @@ -349,7 +352,8 @@ def geo_im_from_array(array_sub, coord, var_name, title, extent[2], extent[3]), crs=proj) # Add coastline to axis - add_shapes(axis) + if shapes: + add_shapes(axis) # Create colormesh, colorbar and labels in axis cbax = make_axes_locatable(axis).append_axes('right', size="6.5%", pad=0.1, axes_class=plt.Axes)