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:
objectPlot 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, orbar.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.
- class fluidsolve.plotext.PlotQHcurve(**kwargs: int)[source]
Bases:
objectPlot 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.