The plotext submodule

High-level plotting helpers for hydraulic Q-H analysis.

This module extends the lower-level plotting utilities by providing domain-focused plotting workflows for pump/circuit interaction diagrams, especially Q-H (flow-head) charts.

Main responsibilities:

  • collect pumps, circuits, and operating points in a unified plot context,

  • generate sampled Q-H curves and overlay system/working points,

  • provide plotting controls for labels, ranges, and slider-driven interaction,

  • bridge hydraulic model objects with matplotlib-based presentation.

Design intent:

  • keep engineering plotting logic close to hydraulic concepts,

  • reduce repetitive plotting boilerplate in examples and notebooks,

  • allow quick visual comparison of pump curves vs circuit demand curves.

Typical usage:

plotter = PlotQHcurve(
    pumps=[pump],
    circuits=[circuit],
    wpoints=[wp],
    npts=80,
)
plotter.show()

For generic figure/canvas mechanics, this module builds on plotlib and adds hydraulic-specific composition rules on top.

class fluidsolve.plotext.PlotSimple(**kwargs: int)[source]

Bases: object

Plot user-provided x/y data on a single graph.

This class does not calculate hydraulic curves. It only renders data that is passed directly to the class.

Parameters:
  • x (list, optional) – X values.

  • y (list, optional) – Y values.

  • type (str, optional) – Curve type: line, scatter, or bar.

  • label (str, optional) – Curve label.

  • color (str, optional) – Curve color.

  • alpha (float, optional) – Curve alpha.

  • linestyle (str, optional) – Curve linestyle.

  • marker (str, optional) – Curve marker.

  • xlabel (str, optional) – X-axis label.

  • ylabel (str, optional) – Y-axis label.

  • xmin (int | float, optional) – X-axis minimum.

  • xmax (int | float, optional) – X-axis maximum.

  • xstep (int | float, optional) – X-axis major tick step.

  • ymin (int | float, optional) – Y-axis minimum.

  • ymax (int | float, optional) – Y-axis maximum.

  • ystep (int | float, optional) – Y-axis major tick step.

__init__(**kwargs: int) None[source]
setData(x: list, y: list) None[source]

Replace the current data series.

prepareShow() None[source]

Build plot objects and assign initial data.

show() None[source]

Prepare and display the plot.

update() None[source]

Redraw the full figure with current data.

updateData() None[source]

Update only curve data without full redraw logic.

class fluidsolve.plotext.PlotQHcurve(**kwargs: int)[source]

Bases: object

Plot a Q-H diagram with pump curves, circuit curves, and working points.

Parameters:
  • pumps (object | list) – Pump or list of pumps.

  • circuits (object | list) – Circuit or list of circuits.

  • wpoints (object | list, optional) – Working points to mark.

  • spoints (object | list, optional) – System (static) points to mark.

  • npts (int, optional) – Number of curve sample points.

  • Qmax (int | float | Quantity, optional) – Maximum flow on Q axis.

  • Hmax (int | float | Quantity, optional) – Maximum head on H axis.

  • xlabel (str, optional) – X-axis label.

  • ylabel (str, optional) – Y-axis label.

  • sliders (list, optional) – Slider widget definitions.

  • xmin (int | float, optional) – X-axis minimum override.

  • xmax (int | float, optional) – X-axis maximum override.

  • xstep (int | float, optional) – X-axis major tick step override.

  • ymin (int | float, optional) – Y-axis minimum override.

  • ymax (int | float, optional) – Y-axis maximum override.

  • ystep (int | float, optional) – Y-axis major tick step override.

__init__(**kwargs: int) None[source]
update() Any[source]

Recalculate and redraw the full figure.

updateData() Any[source]

Recalculate and update only the plot data without a full redraw.

prepareShow() None[source]

Build plot objects and calculate initial data.

show() None[source]

Prepare and display the plot.

_calcAndUpdate() None[source]

Recalculate curves and push updated data to all plot objects.

Q is in m3/h and H in m; all values are passed as bare magnitudes.

_resetControls(event: Any) Any[source]

Reset all slider widgets to their initial values.