Passive Acoustics Module
The passive acoustics module provides a set of functions for analyzing and visualizing passive acoustic monitoring data deployed in water bodies. This package reads in raw .wav files and conducts basic acoustics analysis and visualization.
To start using the module, import it directly from MHKiT:
from mhkit import acoustics. The analysis functions
are available directly from the main import, while the
I/O and graphics submodules are available from
acoustics.io and acoustics.graphics, respectively.
The base functions are intended to be used on top of the I/O submodule, and
include functionality to calibrate data, create spectral densities, sound
pressure levels, and time or band aggregate spectral data.
This module contains key functions for passive acoustics analysis, designed to process and analyze sound pressure data from .wav files in the frequency and time domains. The functions herein build on each other, with a structured flow that facilitates the calculation of sound pressure spectral densities and banded averages based on input audio data.
The following functionality is provided:
Type Validation:
_check_numeric: Validates that a value is of numeric type (int or float).
Frequency Validation and Warning:
_fmax_warning: Ensures specified maximum frequency does not exceed the Nyquist frequency, adjusting if necessary to avoid aliasing.
Shallow Water Cutoff Frequency:
minimum_frequency: Calculates the minimum frequency cutoff based on water depth and the speed of sound in water and seabed materials.
Calculation of Frequency Bands:
create_frequency_bands: Generates frequency bands based on specified octave divisions, minimum and maximum frequency limits, and the chosen base (e.g., 2 for octaves, 10 for decades).
Sound Pressure Spectral Density Calculation:
sound_pressure_spectral_density: Computes the mean square sound pressure spectral density using FFT binning with Hanning windowing and 50% overlap.
Calibration:
apply_calibration: Applies calibration adjustments to the spectral density data using a sensitivity curve, filling missing values as specified.
Band-Averaged Spectral Density:
_get_band_table: Generates a table of frequency bands for logarithmically spaced divisions with optional linear spacing at lower frequencies.
_band_power_spectral_density_v3: Pre-computes bin indices and weights for band averaging.
_band_mean_power_spectral_density_v2: Computes the mean power spectral density within specified bands.
_convert_to_band_spectral_density: Generic function to convert spectral density to custom banded spectral densities.
convert_to_millidecade, convert_to_decidecade, convert_to_third_octave: Convenience functions to convert spectral density to millidecade, decidecade, and third-octave banded spectral densities, respectively.
convert_to_custom_bands: Convert spectral density to custom band spacing with user-specified parameters.
|
Estimate the shallow water cutoff frequency based on the speed of sound in the water column and the speed of sound in the seabed material (generally ranges from 1450 - 1800 m/s) |
|
Calculates frequency bands based on the specified octave, minimum and maximum frequency limits. |
|
Calculates the sound pressure spectral density (SPSD) from audio samples split into FFTs with a specified bin length in seconds, using Hanning windowing with 50% overlap. |
|
Applies custom calibration to spectral density values. |
|
Convert sound pressure spectral density to third octave spacing. |
|
Convert sound pressure spectral density to decidecade spacing. |
|
Convert sound pressure spectral density to millidecade spacing. |
|
Convert sound pressure spectral density to custom band spacing based on specified parameters. |
Spectral Density Level Calculation:
sound_pressure_spectral_density_level: Converts mean square spectral density values to sound pressure spectral density levels in dB.
Spectral Density Aggregation:
band_aggregate: Aggregates spectral density levels into fractional octave bands using specified statistical methods (e.g., median, mean).
time_aggregate: Aggregates spectral density levels into specified time windows using similar statistical methods.
|
Calculates the sound pressure spectral density level from the mean square sound pressure spectral density. |
|
Deprecated. |
|
Deprecated. |
|
Reorganizes spectral density level frequency tensor into time windows and computes the spectral sum for each window. |
|
Reorganizes spectral density level frequency tensor into time windows and computes the energy-averaged SPSDL for each window. |
This module contains key functions related to calculating sound pressure levels from sound pressure data.
Sound Pressure Level Calculation:
sound_pressure_level: Computes the overall sound pressure level within a frequency band from mean square spectral density.
Frequency-Banded Sound Pressure Level:
_band_sound_pressure_level: Helper function for calculating sound pressure levels over specified frequency bandwidths.
third_octave_sound_pressure_level and decidecade_sound_pressure_level: Compute sound pressure levels across third-octave and decidecade bands, respectively.
|
Calculates the sound pressure level (SPL) in a specified frequency band from the mean square sound pressure spectral density (SPSD). |
|
Calculates the sound pressure level in third octave bands directly from the mean square sound pressure spectral density (SPSD). |
|
Calculates the sound pressure level in decidecade bands directly from the mean square sound pressure spectral density (SPSD). |
This module contains key functions related to calculating sound exposure levels from sound pressure data.
Sound Exposure Level Calculation:
nmfs_auditory_weighting: Computes the auditory weighting and exposure functions for marine mammals based on the National Marine Fisheries Service (NMFS) guidelines.
sound_exposure_level: Computes the sound exposure level from within a specified time range.
|
Calculates the auditory weighting and exposure functions for marine mammals based on the National Marine Fisheries Service (NMFS) guidelines. |
|
Calculates the sound exposure level (SEL) across a specified frequency band from the sound pressure spectral density (SPSD). |
- mhkit.acoustics.minimum_frequency(water_depth: int | float | ndarray | list, c: int | float = 1500, c_seabed: int | float = 1700) float | ndarray[source]
Estimate the shallow water cutoff frequency based on the speed of sound in the water column and the speed of sound in the seabed material (generally ranges from 1450 - 1800 m/s)
- Parameters:
water_depth (int, float or array-like) – Depth of the water column in meters.
c (float, optional) – Speed of sound in the water column in meters per second. Default is 1500 m/s.
c_seabed (float, optional) – Speed of sound in the seabed material in meters per second. Default is 1700 m/s.
- Returns:
f_min (float or numpy.ndarray) – The minimum cutoff frequency in Hz.
Reference
———
Jennings 2011 - Computational Ocean Acoustics, 2nd ed.
- mhkit.acoustics.create_frequency_bands(octave, base, fmin, fmax)[source]
Calculates frequency bands based on the specified octave, minimum and maximum frequency limits.
- Parameters:
octave (int) – Octave to subdivide spectral density level by.
base (int, optional) – Octave base. Set to 2 for the true octave band; set to base 10 for the decidecade octave band. Default: 2
fmin (int, optional) – Lower frequency band limit (lower limit of the hydrophone). Default is 10 Hz.
fmax (int, optional) – Upper frequency band limit (Nyquist frequency). Default is 100,000 Hz.
- Returns:
octave_bins (numpy.array) – Array of octave bin edges
band (dict(str, numpy.array)) – Dictionary containing the frequency band edges and center frequency
- mhkit.acoustics.sound_pressure_spectral_density(pressure: DataArray, fs: int | float, bin_length: int | float = 1, fft_length: int | float | None = None, pct_overlap: float = 0.5) DataArray[source]
Calculates the sound pressure spectral density (SPSD) from audio samples split into FFTs with a specified bin length in seconds, using Hanning windowing with 50% overlap. Uses Welch’s method to average overlapping FFT windows within each bin.
- Parameters:
pressure (xarray.DataArray (time)) – Sound pressure in [Pa] or voltage [V]
fs (int or float) – Data collection sampling rate [Hz]
bin_length (int or float) – Length of time in seconds to create FFTs. Default: 1.
fft_length (int or float, optional) – Length of FFT to use. If None, uses bin_length * fs. Default: None.
pct_overlap (float) – Percentage of overlap between FFT segments. Default: 0.5 (50%).
- Returns:
spsd (xarray.DataArray (time_psd, freq)) – Spectral density [Pa^2/Hz] or [V^2/Hz] indexed by time and frequency
- mhkit.acoustics.apply_calibration(spsd: DataArray, sensitivity_curve: DataArray, fill_value: float | int | ndarray, interp_method: str = 'linear') DataArray[source]
Applies custom calibration to spectral density values.
- Parameters:
spsd (xarray.DataArray (time_psd, freq)) – Mean square sound pressure spectral density in V^2/Hz.
sensitivity_curve (xarray.DataArray (freq)) – Calibrated sensitivity curve in units of dB rel 1 V^2/uPa^2. First column should be frequency, second column should be calibration values.
fill_value (float or int) – Value with which to fill missing values from the calibration curve, in units of dB rel 1 V^2/uPa^2.
interp_method (str) – Interpolation method to use when interpolating the calibration curve to the frequencies in ‘spsd’. Default is ‘linear’.
- Returns:
spsd_calibrated (xarray.DataArray (time, freq)) – Spectral density in Pa^2/Hz, indexed by time and frequency.
- mhkit.acoustics.convert_to_third_octave(spsd: DataArray) DataArray[source]
Convert sound pressure spectral density to third octave spacing.
- mhkit.acoustics.convert_to_decidecade(spsd: DataArray) DataArray[source]
Convert sound pressure spectral density to decidecade spacing.
- mhkit.acoustics.convert_to_millidecade(spsd: DataArray) DataArray[source]
Convert sound pressure spectral density to millidecade spacing.
- mhkit.acoustics.sound_pressure_spectral_density_level(spsd: DataArray) DataArray[source]
Calculates the sound pressure spectral density level from the mean square sound pressure spectral density.
- Parameters:
spsd (xarray.DataArray (time_psd, freq)) – Mean square sound pressure spectral density in Pa^2/Hz
- Returns:
spsdl (xarray.DataArray (time, freq)) – Sound pressure spectral density level [dB re 1 uPa^2/Hz] indexed by time and frequency
- mhkit.acoustics.band_aggregate(spsdl: DataArray, octave: Tuple[int, int] = None, fmin: int = 10, fmax: int = 100000, method: str | Dict[str, float | int] = 'median') DataArray[source]
Deprecated. Reorganizes spectral density level frequency tensor into fractional octave bands and applies a function to them.
- Parameters:
spsdl (xarray.DataArray (time, freq)) – Mean square sound pressure spectral density level in dB rel 1 uPa^2/Hz
octave ([int, int]) – Octave and octave base to subdivide spectral density level by. Set to octave base to 2 for the true octave band; set to base 10 for the decidecade octave band. Default = [3, 2] (true third octave)
fmin (int) – Lower frequency band limit (lower limit of the hydrophone). Default: 10 Hz
fmax (int) – Upper frequency band limit (Nyquist frequency). Default: 100000 Hz
method (str or dict) – Method to run on the binned data. Can be a string (e.g., “median”) or a dict where the key is the method and the value is its argument (e.g., {“quantile”: 0.25}). Options: [median, mean, min, max, sum, quantile, std, var, count]
- Returns:
out (xarray.DataArray (time, freq_bins)) – Frequency band-averaged sound pressure spectral density level [dB re 1 uPa^2/Hz] indexed by time and frequency
- mhkit.acoustics.time_aggregate(spsdl: DataArray, window: int = 60, method: str | Dict[str, float | int] = 'median') DataArray[source]
Deprecated. Reorganizes spectral density level frequency tensor into time windows and applies a function to them.
If the window length is equivalent to the size of spsdl[“time”], this function is equivalent to spsdl.<method>(“time”)
- Parameters:
spsdl (xarray.DataArray (time_psd, freq)) – Mean square sound pressure spectral density level in dB rel 1 uPa^2/Hz
window (int) – Time in seconds to subdivide spectral density level into. Default: 60 s.
method (str or dict) – Method to run on the binned data. Can be a string (e.g., “median”) or a dict where the key is the method and the value is its argument (e.g., {“quantile”: 0.25}). Options: [median, mean, min, max, sum, quantile, std, var, count]
- Returns:
out (xarray.DataArray (time_bins, freq)) – Time-averaged sound pressure spectral density level [dB re 1 uPa^2/Hz] indexed by time and frequency
- mhkit.acoustics.time_summation(spsdl, window)[source]
Reorganizes spectral density level frequency tensor into time windows and computes the spectral sum for each window. Values are converted from dB to linear power, summed across the window, then converted back to dB. This represents the total accumulated spectral energy within each window and is proportional to N times the window-averaged SPSDL (where N is the number of input bins per window). It is NOT equivalent to recomputing the SPSD with a longer ‘bin_length’; use ‘time_average’ for that purpose. Note: ‘window’ must be larger than the original ‘bin_length’ of the SPSD.
- Parameters:
spsdl (xarray.DataArray) – Sound pressure spectral density level with dimensions (time_psd, freq)
window (int) – Time in seconds to group spectral density level into.
- Returns:
xarray.DataArray – Time-summed sound pressure spectral density level [dB re 1 uPa^2/Hz] indexed by time and frequency
- mhkit.acoustics.time_average(spsdl, window)[source]
Reorganizes spectral density level frequency tensor into time windows and computes the energy-averaged SPSDL for each window. Values are converted from dB to linear power, averaged across the window, then converted back to dB. This is equivalent to Welch’s method: it produces the same result as recomputing the SPSD from the original time series using ‘bin_length=window’. Note: ‘window’ must be larger than the original ‘bin_length’ of the SPSD.
- Parameters:
spsdl (xarray.DataArray) – Sound pressure spectral density level with dimensions (time_psd, freq)
window (int) – Time in seconds to group spectral density level into.
- Returns:
xarray.DataArray – Time-averaged sound pressure spectral density level [dB re 1 uPa^2/Hz] indexed by time and frequency
- mhkit.acoustics.sound_pressure_level(spsd: DataArray, fmin: int = 10, fmax: int = 100000) DataArray[source]
Calculates the sound pressure level (SPL) in a specified frequency band from the mean square sound pressure spectral density (SPSD).
- Parameters:
spsd (xarray.DataArray (time_psd, freq)) – Mean square sound pressure spectral density in [Pa^2/Hz]
fmin (int) – Lower frequency band limit (lower limit of the hydrophone). Default: 10 Hz
fmax (int) – Upper frequency band limit (Nyquist frequency). Default: 100000 Hz
- Returns:
spl (xarray.DataArray (time)) – Sound pressure level [dB re 1 uPa] indexed by time
- mhkit.acoustics.third_octave_sound_pressure_level(spsd: DataArray, fmin: int = 10, fmax: int = 100000) DataArray[source]
Calculates the sound pressure level in third octave bands directly from the mean square sound pressure spectral density (SPSD).
- Parameters:
spsd (xarray.DataArray (time_psd, freq)) – Mean square sound pressure spectral in [Pa^2/Hz].
fmin (int) – Lower frequency band limit (lower limit of the hydrophone). Default: 10 Hz
fmax (int) – Upper frequency band limit (Nyquist frequency). Default: 100000 Hz
- Returns:
mspl (xarray.DataArray (time, freq_bins)) – Sound pressure level [dB re 1 uPa] indexed by time and third octave bands
- mhkit.acoustics.decidecade_sound_pressure_level(spsd: DataArray, fmin: int = 10, fmax: int = 100000) DataArray[source]
Calculates the sound pressure level in decidecade bands directly from the mean square sound pressure spectral density (SPSD).
- Parameters:
spsd (xarray.DataArray (time_psd, freq)) – Mean square sound pressure spectral density in [Pa^2/Hz].
fmin (int) – Lower frequency band limit (lower limit of the hydrophone). Default: 10 Hz
fmax (int) – Upper frequency band limit (Nyquist frequency). Default: 100000 Hz
- Returns:
mspl (xarray.DataArray (time, freq_bins)) – Sound pressure level [dB re 1 uPa] indexed by time and decidecade bands
- mhkit.acoustics.nmfs_auditory_weighting(frequency, group)[source]
Calculates the auditory weighting and exposure functions for marine mammals based on the National Marine Fisheries Service (NMFS) guidelines.
The weighting function is applied to sound exposure level to determine the auditory impact on marine mammals. The exposure function is the inverse of the weighting function and illustrates how the weighting function relates to marine mammal hearing thresholds. Both function are returned in their log10-transform, in units of dB. To transform back to linear units, use 10**(weighting_func/10).
- Parameters:
frequency (xarray.DataArray (freq)) – Frequency vector in [Hz].
group (str) – Marine mammal group for which the auditory weighting function is applied. Options: ‘LF’ (low frequency cetaceans), ‘HF’ (high frequency cetaceans), ‘VHF’ (very high frequency cetaceans), ‘PW’ (phocid pinnepeds), ‘OW’ (otariid pinnepeds)
- Returns:
weighting_func (xarray.DataArray (freq)) – Auditory weighting function [unitless] indexed by frequency
exposure_func (xarray.DataArray (freq)) – Log-transformed auditory exposure function [dB] indexed by frequency
- mhkit.acoustics.sound_exposure_level(spsd: DataArray, group: str = None, fmin: int = 10, fmax: int = 100000) DataArray[source]
Calculates the sound exposure level (SEL) across a specified frequency band from the sound pressure spectral density (SPSD). If a marine mammal group is provided, the resulting SEL is weighted according to the U.S. National Marine Fisheries Service (NMFS) guidelines.
- Parameters:
spsd (xarray.DataArray (time_psd, freq)) – Sound pressure spectral density in [Pa^2/Hz] with a bin length equal to the time over which sound exposure should be computed.
group (str) – Marine mammal group for which the auditory weighting function is applied. Options: ‘LF’ (low frequency cetaceans), ‘HF’ (high frequency cetaceans), ‘VHF’ (very high frequency cetaceans), ‘PW’ (phocid pinnepeds), ‘OW’ (otariid pinnepeds). Default: None
fmin (int) – Lower frequency band limit (lower limit of the hydrophone). Default: 10 Hz
fmax (int) – Upper frequency band limit (Nyquist frequency). Default: 100000 Hz
- Returns:
sel (xarray.DataArray (time)) – Sound exposure level [dB re 1 uPa^2 s] indexed by time
IO
This submodule provides input/output functions for passive acoustics data, focusing on hydrophone recordings stored in WAV files. The main functionality includes reading and processing hydrophone data from various manufacturers and exporting audio files for easy playback and analysis.
Supported Hydrophone Models
SoundTrap (Ocean Instruments)
icListen (Ocean Sonics)
Functions Overview
Data Reading:
read_hydrophone: Main function to read a WAV file from a hydrophone and convert it to either a voltage or pressure time series, depending on the availability of sensitivity data.
read_soundtrap: Wrapper for reading Ocean Instruments SoundTrap hydrophone files, automatically using appropriate metadata.
read_iclisten: Wrapper for reading Ocean Sonics icListen hydrophone files, including metadata processing to apply hydrophone sensitivity for direct sound pressure calculation.
Audio Export:
export_audio: Converts processed sound pressure data back into a WAV file format, with optional gain adjustment to improve playback quality.
Data Extraction:
_read_wav_metadata: Extracts metadata from a WAV file, including bit depth and other header information.
_calculate_voltage_and_time: Converts raw WAV data into voltage values and generates a time index based on the sampling frequency.
Read .wav file from a hydrophone.
Read .wav file from an Ocean Instruments SoundTrap hydrophone.
Read .wav file from an Ocean Sonics icListen "Smart" hydrophone.
Read WISPR .dat file and return xarray DataArray with voltage time series.
Creates an audio file from an underwater recording.
- mhkit.acoustics.io.read_hydrophone(filename: str | Path, peak_voltage: int | float, sensitivity: int | float | None = None, gain: int | float = 0, start_time: str = '2024-01-01T00:00:00') DataArray[source]
Read .wav file from a hydrophone. Returns voltage timeseries if sensitivity not provided, returns pressure timeseries if it is provided.
- Parameters:
filename (str or pathlib.Path) – Input filename
peak_voltage (int or float) – Peak voltage supplied to the analog to digital converter (ADC) in V. (Or 1/2 of the peak to peak voltage).
sensitivity (int or float) – Hydrophone calibration sensitivity in dB re 1 V/uPa. Should be negative. Default: None.
gain (int or float) – Amplifier gain in dB re 1 V/uPa. Default 0.
start_time (str) – Start time in the format yyyy-mm-ddTHH:MM:SS
- Returns:
out (numpy.array) – Sound pressure [Pa] or Voltage [V] indexed by time[s]
- mhkit.acoustics.io.read_soundtrap(filename: str, sensitivity: int | float | None = None, gain: int | float = 0) DataArray[source]
Read .wav file from an Ocean Instruments SoundTrap hydrophone. Returns voltage timeseries if sensitivity not provided, returns pressure timeseries if it is provided.
- Parameters:
filename (str) – Input filename.
sensitivity (int or float, optional) – Hydrophone calibration sensitivity in dB re 1 V/μPa. Should be negative. Default is None.
gain (int or float) – Amplifier gain in dB re 1 V/μPa. Default is 0.
- Returns:
out (xarray.DataArray) – Sound pressure [Pa] or Voltage [V] indexed by time[s].
- mhkit.acoustics.io.read_iclisten(filename: str, sensitivity: int | float | None = None, use_metadata: bool = True) DataArray[source]
Read .wav file from an Ocean Sonics icListen “Smart” hydrophone. Returns voltage timeseries if sensitivity not provided, returns pressure timeseries if it is provided.
- Parameters:
filename (str) – Input filename.
sensitivity (int or float, optional) – Hydrophone calibration sensitivity in dB re 1 V/μPa. Should be negative. Default is None.
use_metadata (bool) – If True and sensitivity is None, applies sensitivity value stored in the .wav file’s LIST block. If False and sensitivity is None, a sensitivity value isn’t applied.
- Returns:
out (xarray.DataArray) – Sound pressure [Pa] or Voltage [V] indexed by time[s].
- mhkit.acoustics.io.read_wispr(file_path)[source]
Read WISPR .dat file and return xarray DataArray with voltage time series.
- Parameters:
file_path (str) – Path to WISPR .dat file.
- Returns:
xr.DataArray – DataArray containing voltage time series and metadata.
- mhkit.acoustics.io.export_audio(filename: str, pressure: DataArray, peak_voltage: int | float = None, gain: int | float = 1, resample_multiplier: int = 1) None[source]
Creates an audio file from an underwater recording.
- Parameters:
filename (str) – Output filename for the WAV file (without extension).
pressure (xarray.DataArray) –
- Sound pressure or voltage data with attributes:
’sensitivity’ (int or float): Sensitivity of the hydrophone in dB.
’fs’ (int or float): Sampling frequency in Hz.
- ’peak_voltage’ or ‘valid_max’ (int or float): Peak voltage of the analog-to-digital
converter.
peak_voltage (int or float) – Peak voltage of the analog-to-digital converter.
gain (int or float, optional) – Gain to multiply the original time series by. Default is 1.
resample_multiplier (int, optional) – Multiplier for resampling the pressure to speed up the recording, which is useful for listening to low frequency sound. Default is 1 (no resampling).
Graphics
This submodule provides essential plotting functions for visualizing passive acoustics data. The functions allow for customizable plotting of sound pressure spectral density levels across time and frequency dimensions.
Each plotting function leverages the flexibility of Matplotlib, allowing for passthrough
of Matplotlib keyword arguments via **kwargs, making it easy to modify plot aspects such as
color, scale, and label formatting.
Key Functions
plot_spectrogram:
Generates a spectrogram plot from sound pressure spectral density level data, with a logarithmic frequency scale by default for improved readability of acoustic data.
plot_spectra:
Produces a spectral density plot with a log-transformed x-axis, allowing for clear visualization of spectral density across frequency bands.
Plots the spectrogram of the sound pressure spectral density level.
Plots spectral density.
- mhkit.acoustics.graphics.plot_spectrogram(spsdl: DataArray, fmin: int = 10, fmax: int = 100000, fig: figure = None, ax: Axes = None, **kwargs) Tuple[figure, Axes][source]
Plots the spectrogram of the sound pressure spectral density level.
- Parameters:
spsdl (xarray DataArray (time, freq)) – Mean square sound pressure spectral density level in dB rel 1 uPa^2/Hz
fmin (int) – Lower frequency band limit (lower limit of the hydrophone). Default: 10 Hz
fmax (int) – Upper frequency band limit (Nyquist frequency). Default: 100000 Hz
fig (matplotlib.pyplot.figure) – Figure handle to plot on
ax (matplotlib.pyplot.axis) – Figure axis containing plot objects
kwargs (dict) – Dictionary of matplotlib function keyword arguments
- Returns:
fig (matplotlib.pyplot.figure) – Figure handle of plot
ax (matplotlib.pyplot.Axes) – Figure plot axis
- mhkit.acoustics.graphics.plot_spectra(spsdl: DataArray, fmin: int = 10, fmax: int = 100000, fig: figure = None, ax: Axes = None, **kwargs) Tuple[figure, Axes][source]
Plots spectral density. X axis is log-transformed.
- Parameters:
spsdl (xarray DataArray (time, freq)) – Mean square sound pressure spectral density level in dB rel 1 uPa^2/Hz
fmin (int) – Lower frequency band limit (lower limit of the hydrophone). Default: 10 Hz
fmax (int) – Upper frequency band limit (Nyquist frequency). Default: 100000 Hz
fig (matplotlib.pyplot.figure) – Figure handle to plot on
ax (matplotlib.pyplot.Axes) – Figure axis containing plot objects
kwargs (dict) – Dictionary of matplotlib function keyword arguments
- Returns:
fig (matplotlib.pyplot.figure) – Figure handle of plot
ax (matplotlib.pyplot.Axes) – Figure plot axis