Plotting helpers¶
Package
Module scubas.plotlib
Class PlotArtifacts
Method / Function update_rc_params, plot_transfer_function, potential_along_section, cable_potential
Return type
Plot helpers return a PlotArtifacts object to make figure/axes reuse and
custom post-processing easier.
scubas.plotlib now offers lightweight plotting utilities that return a
typed PlotArtifacts dataclass containing the Figure and Axes objects.
The helpers respect optional “science” styling, accept numpy arrays directly,
and summarise the most common inspection plots used in the cable/conductivity
workflows.
Quick start¶
import numpy as np
from scubas.plotlib import PlotArtifacts, plot_transfer_function
class DummyTF:
freq = np.logspace(-4, -2, 5)
E2B = np.exp(1j * np.linspace(0, np.pi / 2, 5))
artifacts = plot_transfer_function(DummyTF())
assert isinstance(artifacts, PlotArtifacts)
artifacts.figure.savefig("transfer_function.png")
Similar helpers are available for plotting along-section potentials and whole Cable potentials.
API reference¶
scubas.plotlib.PlotArtifacts
dataclass
¶
scubas.plotlib.update_rc_params(params=None, science=False, latex=False)
¶
Update matplotlib rcParams, optionally enabling the science style.
Source code in scubas/plotlib.py
scubas.plotlib.plot_transfer_function(Tx, xlim=(1e-06, 0.01), ylim=(0.001, 1.0), science=False)
¶
Plot amplitude and phase of an E2B transfer function.
Source code in scubas/plotlib.py
scubas.plotlib.potential_along_section(V, x, sec=None, Vi=None, Vk=None, Z=None, Y=None, gma=None, Z0=None, science=False)
¶
Visualise along-section potential with optional annotations.
Source code in scubas/plotlib.py
scubas.plotlib.cable_potential(V, x, science=False, ylim=(-50, 50))
¶
Plot potential along the full cable.