Skip to content

Plot

subsurfaceio.logplot.render.columns.plot

Matplotlib → SVG plot column renderer.

Classes:

Name Description
PlotColumnRenderer

Renders continuous data plots via matplotlib → SVG.

Functions:

Name Description
cap_step_series

Add the missing endpoint so step styles cover every sample interval.

PlotColumnRenderer

Renders continuous data plots via matplotlib → SVG.

Methods:

Name Description
render

Render plot series for the current page y-window.

render staticmethod

render(column: Column, ctx: RenderContext) -> str

Render plot series for the current page y-window.

Parameters:

Name Type Description Default
column Column

Column whose model is a PlotColumn.

required
ctx RenderContext

Page geometry and dumped data.

required

Returns:

Type Description
str

Standalone <svg>…</svg> fragment from matplotlib.

Raises:

Type Description
TypeError

If column.model is not a PlotColumn.

cap_step_series

cap_step_series(
    rows: list[dict[str, Any]],
    *,
    x_field: str,
    y_field: str,
    drawstyle: str
) -> tuple[list[Any], list[Any]]

Add the missing endpoint so step styles cover every sample interval.

steps-post with y_field='depth' prepends the first plotted sample's depth_top. steps and steps-pre with y_field='depth_top' append the last plotted sample's depth. Other draw styles are returned unchanged.

Parameters:

Name Type Description Default
rows list[dict[str, Any]]

Dumped data rows for one series.

required
x_field str

Horizontal data field.

required
y_field str

Vertical field.

required
drawstyle str

Matplotlib draw style.

required

Returns:

Type Description
tuple[list[Any], list[Any]]

(xs, ys) to pass to Axes.plot.