netsse.tools.viz.plot_bathymetry ================================ .. py:function:: netsse.tools.viz.plot_bathymetry(depths, shp_dict, ax, cmap='Blues_r') Plots the bathymetry map for a given area. The function plots the bathymetry map for a given area using the shapefiles contained in the dictionary `shp_dict`. The shapefiles are sorted by depth, from the surface to the bottom. :param depths: List of the depths in the shapefiles for the specified area. :type depths: list :param shp_dict: Dictionary containing the shapefiles. :type shp_dict: dict :param ax: Axes object to plot on. :type ax: matplotlib.axes :param cmap: Colormap to use for the plot. Default is ``'Blues_r'``. .. note:: Other colormap options include ``'plasma'``, ``'inferno'``, ``'magma'``, ``'viridis'``. Visit the `Matplotlib documentation `_ for an overview of the options. :type cmap: str, optional :returns: * **ax** (*matplotlib.axes._subplots.AxesSubplot*) -- The axes object with the plot. * **colormap** (*matplotlib.colors.ListedColormap*) -- The colormap used for the plot. .. seealso:: :py:obj:`netsse.model.bathymetry.load_bathymetry` Retrieve and read bathymetry shapefiles. .. rubric:: Example .. code-block:: python import matplotlib.pyplot as plt import cartopy.crs as ccrs import cartopy.feature as cfeature from netsse.model.bathymetry import load_bathymetry from netsse.tools.viz import plot_bathymetry depths, shp_dict = load_bathymetry(lonmin=-5, lonmax=15, latmin=35, latmax=45) fig, ax = plt.subplots(subplot_kw={'projection':ccrs.Mercator(central_longitude=5,min_latitude=35,max_latitude=45)},figsize=(6,6)) ax.set_extent([-5, 15, 35, 45], crs=ccrs.PlateCarree()) ax, colormap = plot_bathymetry(depths, shp_dict, ax) ax.add_feature(cfeature.LAND,edgecolor='black',facecolor='gainsboro',alpha=0.5)