Index
subsurfaceio.geotech_plot
Geotechnical plotting API.
Wraps the general-purpose plotting layer with the conventions geotechnical plots need: reversed depth axes, per-parameter axis scales, data-bin bands, and categorical strata drawn as colored layers.
Following subsurfaceio.plot, this package exports only the configuration models; each backend figure comes from its own module:
from subsurfaceio.geotech_plot.figure_plotly import GeotechFigure
from subsurfaceio.plot import Line
fig = GeotechFigure(
reverse_y=True,
plot_model=Line(plot_type='line', data_frame=df, x='cone_tip_resistance', y='depth'),
).plot().fig
GeotechFigure is the matplotlib
equivalent and requires the mpl extra.
Modules:
| Name | Description |
|---|---|
base |
Shared configuration for geotechnical figures. |
figure_mpl |
Matplotlib renderer for geotechnical figures. |
figure_plotly |
Plotly renderer for geotechnical figures. |
mixins |
Geotechnical figure mixins for axes, styling, strata, and data-bin shapes. |
Classes:
| Name | Description |
|---|---|
AxisMap |
How to scale and bound the axis a given parameter is drawn on. |
StyleMap |
Line and marker styling for one named trace. |
Attributes:
| Name | Type | Description |
|---|---|---|
DEFAULT_AXIS_MAP |
dict[str, AxisMap]
|
Conventional axis treatment for parameters that need a non-default scale. |
DEFAULT_AXIS_MAP
module-attribute
DEFAULT_AXIS_MAP: dict[str, AxisMap] = {
"material_index": AxisMap(
type="log", autorange=False, range=(-1, 1)
),
"soil_behavior_type_index": AxisMap(
autorange=False, range=(1, 4)
),
"modified_soil_behavior_type_index": AxisMap(
type="log", autorange=False, range=(1, 2)
),
"permeability": AxisMap(type="log"),
"coefficient_of_consolidation": AxisMap(type="log"),
"soil_classification_index": AxisMap(
type="log", autorange=False, range=(1, 2.69897)
),
}
Conventional axis treatment for parameters that need a non-default scale.
GeotechFigureT
module-attribute
AxisMap
pydantic-model
Bases: BaseModel
How to scale and bound the axis a given parameter is drawn on.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
Literal['linear', 'log', 'category']
|
Axis scale. |
rangemode |
Literal['normal', 'tozero', 'nonnegative']
|
How the automatic range treats zero. |
autorange |
AutoRange
|
Automatic range behavior. |
range |
tuple[float, float] | None
|
Lower and upper bound, or |
Fields:
-
type(Literal['linear', 'log', 'category']) -
rangemode(Literal['normal', 'tozero', 'nonnegative']) -
autorange(AutoRange) -
range(tuple[float, float] | None)
mpl_lim
property
range converted to data coordinates for matplotlib.
Plotly takes logarithmic bounds as exponents while matplotlib takes them as data values, so exponents are raised here.
Returns:
| Type | Description |
|---|---|
tuple[float, float] | None
|
Axis limits in data coordinates, or |
StyleMap
pydantic-model
Bases: BaseModel
Line and marker styling for one named trace.
Expressed in Plotly terms and translated for matplotlib by mpl_props.
Color, dash, and symbol are deliberately absent: those are handled through
the express color_discrete_map, line_dash_map, and symbol_map
arguments instead, which support both backends natively.
Attributes:
| Name | Type | Description |
|---|---|---|
mode |
TraceMode | None
|
Whether to draw lines, markers, or both. |
marker_size |
float | None
|
Marker size in points. |
line_shape |
LineShape | None
|
Interpolation between points. |
line_width |
float | None
|
Line width in points. |
Fields:
-
mode(TraceMode | None) -
marker_size(float | None) -
line_shape(LineShape | None) -
line_width(float | None)