gerg_plotting.plotting_classes.scatter_plot#

Module Contents#

class gerg_plotting.plotting_classes.scatter_plot.ScatterPlot#

Bases: gerg_plotting.plotting_classes.plotter.Plotter

Class for creating scatter plots from Data objects.

Inherits from Plotter class for basic plotting functionality. Provides methods for various scatter plot types including T-S diagrams, hovmoller plots, and velocity vector plots.

TS(color_var=None, fig=None, ax=None, contours: bool = True, scatter_kwargs=None, contour_kwargs=None) None#

Create temperature-salinity diagram.

Parameters#

color_varstr or None, optional

Variable name for color mapping

figmatplotlib.figure.Figure, optional

Figure to plot on

axmatplotlib.axes.Axes, optional

Axes to plot on

contoursbool, optional

Whether to show sigma-theta contours, default True

scatter_kwargsdict, optional

Additional arguments to pass to scatter plot (see matplotlib.pyplot.scatter)

contour_kwargsdict, optional

Additional arguments to pass to contour plot (see matplotlib.pyplot.contour)

calculate_quiver_step(num_points, quiver_density) int#

Calculate step size for quiver plot density.

Parameters#

num_pointsint

Total number of data points

quiver_densityint

Desired density of quiver arrows

Returns#

int

Step size for data sampling

abstract cross_section(longitude, latitude) None#

Method placeholder for plotting cross-sections.

Args:

longitude: Longitude line for the cross-section. latitude: Latitude line for the cross-section.

Raises:

NotImplementedError: Indicates that the method is not yet implemented.

get_density_color_data(color_var: str) numpy.ndarray#

Get color data for density plotting.

Parameters#

color_varstr

Variable name for color data

Returns#

np.ndarray

Array of color values

hovmoller(var: str, fig=None, ax=None, **scattter_kwargs) None#

Create depth vs time plot colored by variable.

Parameters#

varstr

Variable name for color mapping

figmatplotlib.figure.Figure, optional

Figure to plot on

axmatplotlib.axes.Axes, optional

Axes to plot on

**scattter_kwargs

Additional arguments for scatter plot (see matplotlib.pyplot.scatter)

power_spectra_density(psd_freq=None, psd=None, var_name: str = None, sampling_freq=None, segment_length=None, theta_rad=None, highlight_freqs: list = None, fig=None, ax=None) None#

Create power spectral density plot.

Parameters#

psd_freqarray-like, optional

Frequency values

psdarray-like, optional

Power spectral density values

var_namestr, optional

Variable name for PSD calculation

sampling_freqfloat, optional

Sampling frequency

segment_lengthint, optional

Length of segments for PSD calculation

theta_radfloat, optional

Angle in radians

highlight_freqslist, optional

Frequencies to highlight

figmatplotlib.figure.Figure, optional

Figure to plot on

axmatplotlib.axes.Axes, optional

Axes to plot on

Raises#

ValueError

If neither PSD values nor calculation parameters are provided

quiver1d(x: str, quiver_density: int = None, quiver_scale: float = None, fig=None, ax=None) None#

Create 1D quiver plot for velocity data.

Parameters#

xstr

Variable name for x-axis

quiver_densityint, optional

Density of quiver arrows

quiver_scalefloat, optional

Scaling factor for arrow length

figmatplotlib.figure.Figure, optional

Figure to plot on

axmatplotlib.axes.Axes, optional

Axes to plot on

quiver2d(x: str, y: str, quiver_density: int = None, quiver_scale: float = None, fig=None, ax=None) None#

Create 2D quiver plot for velocity data.

Parameters#

xstr

Variable name for x-axis

ystr

Variable name for y-axis

quiver_densityint, optional

Density of quiver arrows

quiver_scalefloat, optional

Scaling factor for arrow length

figmatplotlib.figure.Figure, optional

Figure to plot on

axmatplotlib.axes.Axes, optional

Axes to plot on

scatter(x: str, y: str, color_var: str | None = None, invert_yaxis: bool = False, fig=None, ax=None, **scattter_kwargs) None#

Create scatter plot of two variables with optional color mapping.

Parameters#

xstr

Variable name for x-axis

ystr

Variable name for y-axis

color_varstr or None, optional

Variable name for color mapping

invert_yaxisbool, optional

Whether to invert y-axis

figmatplotlib.figure.Figure, optional

Figure to plot on

axmatplotlib.axes.Axes, optional

Axes to plot on

**scattter_kwargs

Additional arguments for scatter plot (see matplotlib.pyplot.scatter)

Returns#

matplotlib.collections.PathCollection

Scatter plot object

scatter3d(x: str, y: str, z: str, color_var: str | None = None, invert_yaxis: bool = False, fig=None, ax=None, **scattter_kwargs) None#

Create scatter plot of two variables with optional color mapping.

Parameters#

xstr

Variable name for x-axis

ystr

Variable name for y-axis

color_varstr or None, optional

Variable name for color mapping

invert_yaxisbool, optional

Whether to invert y-axis

figmatplotlib.figure.Figure, optional

Figure to plot on

axmatplotlib.axes.Axes, optional

Axes to plot on

**scattter_kwargs

Additional arguments for scatter plot (see matplotlib.pyplot.scatter)

Returns#

matplotlib.collections.PathCollection

Scatter plot object

tricontourf(x: str, y: str, z: str, fig=None, ax=None, levels=None)#

Create filled contour plot of irregular grid data.

Parameters#

xstr

Variable name for x-axis

ystr

Variable name for y-axis

zstr

Variable name for contour values

figmatplotlib.figure.Figure, optional

Figure to plot on

axmatplotlib.axes.Axes, optional

Axes to plot on

levelsint, optional

Number of contour levels