gerg_plotting.plotting_classes.map_plot#

Module Contents#

class gerg_plotting.plotting_classes.map_plot.MapPlot#

Bases: gerg_plotting.plotting_classes.plotter.Plotter

A class for plotting geographic data on maps using Cartopy and Matplotlib.

Parameters#

bathyBathy, optional

Bathymetric data object

grid_spacingint, optional

Spacing between gridlines in degrees, default is 1

Attributes#

scmatplotlib.collections.PathCollection

Scatter plot collection

glcartopy.mpl.gridliner.Gridliner

Gridliner for map coordinates

cbar_varmatplotlib.colorbar.Colorbar

Colorbar for plotted variable

cbar_bathymatplotlib.colorbar.Colorbar

Colorbar for bathymetry

bathy: gerg_plotting.data_classes.bathy.Bathy#
property bathy_initialized#

Check if bathymetry is properly initialized

cbar_bathy: matplotlib.colorbar.Colorbar#
cbar_var: matplotlib.colorbar.Colorbar#
property coordinate_labels#

Configure coordinate label formatting

get_color_settings(var: str | None) tuple[str | numpy.ndarray, matplotlib.colors.Colormap]#

Get color and colormap settings for specified variable.

Parameters#

varstr or None

Variable name for color mapping

Returns#

tuple

(color, cmap) where color is str or ndarray and cmap is Colormap

gl: cartopy.mpl.gridliner.Gridliner#
grid_spacing: int#
property gridlines#

Configure and return gridlines based on current settings

property map_extent#

Get map extent from data bounds

quiver(x: str = 'lon', y: str = 'lat', quiver_density: int = None, quiver_scale: float = None, grid: bool = True, show_bathy: bool = True, show_coastlines: bool = True, fig=None, ax=None) None#

Create quiver plot for vector data.

Parameters#

xstr, optional

X-axis variable name, default ‘lon’

ystr, optional

Y-axis variable name, default ‘lat’

quiver_densityint, optional

Density of quiver arrows

quiver_scalefloat, optional

Scaling factor for arrow length

gridbool, optional

Whether to show grid, default True

show_bathybool, optional

Whether to show bathymetry, default True

show_coastlinesbool, optional

Whether to show coastlines, default True

figmatplotlib.figure.Figure, optional

Figure to plot on

axmatplotlib.axes.Axes, optional

Axes to plot on

property quiver_step#

Step size for quiver plot density based on data length

sc: matplotlib.collections.PathCollection#
scatter(var: str | None = None, show_bathy: bool = True, show_coastlines: bool = True, pointsize=3, linewidths=0, grid=True, show_coords=True, fig=None, ax=None) None#

Create scatter plot of points on map.

Parameters#

varstr or None, optional

Variable name for color mapping

show_bathybool, optional

Whether to show bathymetry, default True

show_coastlinesbool, optional

Whether to show coastlines, default True

pointsizeint, optional

Size of scatter points, default 3

linewidthsint, optional

Width of point edges, default 0

gridbool, optional

Whether to show grid, default True

show_coordsbool, optional

Whether to show coordinates, default True

figmatplotlib.figure.Figure, optional

Figure to plot on

axmatplotlib.axes.Axes, optional

Axes to plot on