gerg_plotting.plotting_classes.map_plot ======================================= .. py:module:: gerg_plotting.plotting_classes.map_plot Module Contents --------------- .. py:class:: MapPlot Bases: :py:obj:`gerg_plotting.plotting_classes.plotter.Plotter` A class for plotting geographic data on maps using Cartopy and Matplotlib. Parameters ---------- bathy : Bathy, optional Bathymetric data object grid_spacing : int, optional Spacing between gridlines in degrees, default is 1 Attributes ---------- sc : matplotlib.collections.PathCollection Scatter plot collection gl : cartopy.mpl.gridliner.Gridliner Gridliner for map coordinates cbar_var : matplotlib.colorbar.Colorbar Colorbar for plotted variable cbar_bathy : matplotlib.colorbar.Colorbar Colorbar for bathymetry .. py:attribute:: bathy :type: gerg_plotting.data_classes.bathy.Bathy .. py:property:: bathy_initialized Check if bathymetry is properly initialized .. py:attribute:: cbar_bathy :type: matplotlib.colorbar.Colorbar .. py:attribute:: cbar_var :type: matplotlib.colorbar.Colorbar .. py:property:: coordinate_labels Configure coordinate label formatting .. py:method:: get_color_settings(var: str | None) -> tuple[str | numpy.ndarray, matplotlib.colors.Colormap] Get color and colormap settings for specified variable. Parameters ---------- var : str or None Variable name for color mapping Returns ------- tuple (color, cmap) where color is str or ndarray and cmap is Colormap .. py:attribute:: gl :type: cartopy.mpl.gridliner.Gridliner .. py:attribute:: grid_spacing :type: int .. py:property:: gridlines Configure and return gridlines based on current settings .. py:property:: map_extent Get map extent from data bounds .. py:method:: 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 ---------- x : str, optional X-axis variable name, default 'lon' y : str, optional Y-axis variable name, default 'lat' quiver_density : int, optional Density of quiver arrows quiver_scale : float, optional Scaling factor for arrow length grid : bool, optional Whether to show grid, default True show_bathy : bool, optional Whether to show bathymetry, default True show_coastlines : bool, optional Whether to show coastlines, default True fig : matplotlib.figure.Figure, optional Figure to plot on ax : matplotlib.axes.Axes, optional Axes to plot on .. py:property:: quiver_step Step size for quiver plot density based on data length .. py:attribute:: sc :type: matplotlib.collections.PathCollection .. py:method:: 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 ---------- var : str or None, optional Variable name for color mapping show_bathy : bool, optional Whether to show bathymetry, default True show_coastlines : bool, optional Whether to show coastlines, default True pointsize : int, optional Size of scatter points, default 3 linewidths : int, optional Width of point edges, default 0 grid : bool, optional Whether to show grid, default True show_coords : bool, optional Whether to show coordinates, default True fig : matplotlib.figure.Figure, optional Figure to plot on ax : matplotlib.axes.Axes, optional Axes to plot on