pycsamt.api.section#
Global section-view controls for pyCSAMT figures.
This module centralizes layout choices used by 2-D section-like plots:
pseudo-sections, inversion sections, model slices, and compact dashboard
panels. It complements pycsamt.api.style,
pycsamt.api.station, pycsamt.api.control, and
pycsamt.api.plot.
Examples
Apply a publication section preset temporarily:
from pycsamt.api.section import PYCSAMT_SECTION
from pycsamt.tdem import plot_temavg_section
with PYCSAMT_SECTION.context("publication"):
ax = plot_temavg_section(avg, section="publication")
Use the data-aware dynamic layout for many stations:
ax = plot_temavg_section(avg, section="dynamic")
Customize one preset globally:
from pycsamt.api import configure_section
configure_section(
dynamic__figure__max_width=16.0,
dynamic__colorbar__max_ticks=5,
)
Functions
|
Configure |
Reset |
Classes
Package-wide section-view control container. |
|
|
Axis behavior for section-like plots. |
|
Colorbar geometry and tick-density controls. |
|
Figure geometry for section-like plots. |
|
Complete visual-control bundle for one section preset. |
- class pycsamt.api.section.PyCSAMTSection[source]#
Bases:
objectPackage-wide section-view control container.
- style_for(preset='pseudosection')[source]#
Return the section style associated with
preset.- Parameters:
preset (str)
- Return type:
- configure(**kw)[source]#
Configure section styles using
section__attributepaths.- Parameters:
kw (Any)
- Return type:
None
- context(preset=None, **kw)[source]#
Temporarily override section styles, then restore them.
- Parameters:
- Return type:
Generator[PyCSAMTSection, None, None]
- class pycsamt.api.section.SectionAxisStyle(xlabel='Station', ylabel=None, y_direction='down', aspect='auto', grid=False, station_side='top', title=True, xlabel_pad=None, ylabel_pad=None, y_type='depth')[source]#
Bases:
objectAxis behavior for section-like plots.
- Parameters:
- class pycsamt.api.section.SectionColorbarStyle(show=True, side='right', size='3.5%', pad=0.04, max_ticks=6, tick_format=None)[source]#
Bases:
objectColorbar geometry and tick-density controls.
- Parameters:
- class pycsamt.api.section.SectionFigureStyle(figsize=(9.5, 4.4), tight=True, constrained=False, title=True, min_width=7.0, max_width=14.0, min_height=3.2, max_height=7.5, station_width=0.16, y_sample_height=0.03, label_width=0.055, colorbar_width=0.55)[source]#
Bases:
objectFigure geometry for section-like plots.
- Parameters:
- class pycsamt.api.section.SectionStyle(figure=<factory>, axis=<factory>, colorbar=<factory>, station_preset='pseudosection')[source]#
Bases:
objectComplete visual-control bundle for one section preset.
- Parameters:
figure (SectionFigureStyle)
axis (SectionAxisStyle)
colorbar (SectionColorbarStyle)
station_preset (str)
- figure: SectionFigureStyle#
- axis: SectionAxisStyle#
- colorbar: SectionColorbarStyle#
- topo_active()[source]#
Return True when the global topo config applies to this section.
Checks
PYCSAMT_TOPOagainstself.axis.y_type. Period / frequency sections return False even when topo is globally enabled, because they carry no real elevation information.- Return type:
- copy(**kw)[source]#
Return a modified deep copy of this section style.
- Parameters:
kw (Any)
- Return type:
- figsize_for(*, n_stations=None, n_y=None, labels=None, colorbar=True)[source]#
Return a concrete figure size for this section.
- add_colorbar(mappable, ax, *, label=None, **kw)[source]#
Attach a colorbar using this style’s colorbar policy.