geodata.mask.show#
- geodata.mask.show(raster: rasterio.DatasetReader | str, shape: geopandas.GeoSeries | None = None, shape_width: float = 0.5, shape_color: str = 'black', figsize: tuple[float, float] = (10, 6), title: str | None = None, title_size: float = 12, lat_lon: bool = True, colorbar: bool = True, grid: bool = False, return_fig: bool = False, **kwargs) matplotlib.pyplot.Figure | None#
Plot a raster file.
- Parameters:
raster (ras.DatasetReader | str) – A rasterio.DatasetReader or string. If a string is passed, the method will open the raster file using open_tif() method.
shape (geopandas.GeoSeries) – Shapes to be plotted over the raster. None by default.
shape_width (float) – The line width for plotting shapes. 0.5 by default.
shape_color (str) – Color of the shape border. Black by default.
figsize (tuple[float, float]) – The size of the figure. (10, 6) by default.
title (str) – The title of the plot. If not specified, the title will be the name of the raster.
lat_lon (bool) – Whether the program will show the lat/long coordinates in the plot. True by default.
colorbar (bool) – Whether the program shows the legend for the values of the plot. True by default.
grid (bool) – whether the program shows the grid. False by default.
return_fig (bool) – Whether to return the matplotlib figure. False by default.
**kwargs – Other keyword arguments to be passed to matplotlib.pyplot.imshow().
- Returns:
The matplotlib figure. Only returned if return_fig is True.
- Return type:
matplotlib.figure.Figure