visualdynamics.plot.bars¶
bars
¶
The comparison as bar charts: a bar per control channel.
A table of six channels is read; a table of sixty is scanned, and the one channel that matters is somewhere in it. A bar chart is the same numbers arranged so the answer is the shape rather than a row — which channel is worst, how many are out, and by how much, before anything is read at all.
Two charts, because a random vibration run is judged two ways and they disagree often enough to be worth seeing apart. RMS error is the level: how far the whole channel sits from what was asked for, in dB. Lines outside abort is the shape: a channel can sit at exactly the right level and still be out of tolerance across half its band, and one that is 2 dB low everywhere may never cross an abort limit at all.
A threshold is drawn as shaded ground rather than as a line: what is being said is "past here is out", and a filled region says it where a line leaves it to be inferred — red past the upper, blue past the lower, the same two colors the specification plot shades its abort zones with. The shading is the handle, and dragging it snaps to a tenth of a dB or of a percent. A tolerance is a judgment — ±3 dB and a tenth of the band are where most specifications land, not where they all do — so those are a starting point, and everything reads off wherever they are put. In a report they are drawn and not moved: there is nobody on the other end of a drag in a file.
Classes:
| Name | Description |
|---|---|
BarChart |
A bar per channel, a threshold that can be dragged, and a count. |
Functions:
| Name | Description |
|---|---|
error_chart |
How far each channel's RMS sits from what was asked for, in dB. |
lines_chart |
How much of each channel's band fell outside its abort limits. |
level_chart |
The RMS level each channel of a specification asks for, a bar |
kurtosis_chart |
How Gaussian each channel is: Pearson kurtosis, a bar apiece. |
snr_chart |
How far each channel's signal stands above its noise: RMS |
replication_chart |
One reading of a transient replication, a bar per control channel. |
Classes¶
BarChart
¶
BarChart(plot: Any, rows: Sequence[tuple[str, float]], colors: Mapping[str, str], low: float | None, high: float | None = None, changed: Callable[..., None] | None = None, label: str = '', units: str = '', neutral: str = 'response_curve', baseline: float = 0.0, summary: str = 'over', side: str = 'over')
A bar per channel, a threshold that can be dragged, and a count.
Owns its plot. changed is called with the thresholds whenever one
is moved, so whoever put the chart up can remember where they were
put — a threshold that reset on every redraw would be no threshold
at all.
Methods:
| Name | Description |
|---|---|
beyond |
Which way this bar is out, or None. |
share |
The percentage of channels outside, wherever the lines are. |
summary_text |
The count the chart states: how many channels are out, of how |
key |
What the colors mean, into |
set_threshold |
Move a threshold, snapped, and restate everything from it. |
Source code in src/visualdynamics/plot/bars.py
Methods:¶
beyond
¶
Which way this bar is out, or None.
A one-sided chart has a ceiling and no floor — no amount of
staying inside the abort limits is a fault — or, with side
'under', a floor and no ceiling. On a floor chart a value with
no number (NaN) is under it: a signal-to-noise with no signal
above the noise is the worst a channel can read, not a blank.
Source code in src/visualdynamics/plot/bars.py
share
¶
The percentage of channels outside, wherever the lines are.
Source code in src/visualdynamics/plot/bars.py
summary_text
¶
The count the chart states: how many channels are out, of how many, and the share — or, with no thresholds, how many there are and which is highest, the way a table's eye runs down its column.
Source code in src/visualdynamics/plot/bars.py
key
¶
What the colors mean, into legend (plot.legend_below): the
bars inside, over and under the thresholds, and the ground past
each — a figure read on its own had no key for any of it
(2026-09-26). A chart with no thresholds colors nothing, and
adds nothing.
Source code in src/visualdynamics/plot/bars.py
set_threshold
¶
Move a threshold, snapped, and restate everything from it.
What dragging the shading does, and what a caller does to set one outright — one path, so a dragged threshold and a stored one cannot land on different numbers.
Source code in src/visualdynamics/plot/bars.py
Functions:¶
error_chart
¶
error_chart(plot: Any, rows: Sequence[tuple[str, float, float]], colors: Mapping[str, str], low: float = -ERROR_DB, high: float = ERROR_DB, changed: Callable[..., None] | None = None, **options: Any) -> BarChart
How far each channel's RMS sits from what was asked for, in dB.
Two thresholds, moved independently: a specification is not always written symmetrically, and over-testing and under-testing are not the same fault.
Source code in src/visualdynamics/plot/bars.py
lines_chart
¶
lines_chart(plot: Any, rows: Sequence[tuple[str, float, float]], colors: Mapping[str, str], low: float = LINES_PERCENT, changed: Callable[..., None] | None = None, **options: Any) -> BarChart
How much of each channel's band fell outside its abort limits.
Source code in src/visualdynamics/plot/bars.py
level_chart
¶
level_chart(plot: Any, rows: Sequence[tuple[str, float]], colors: Mapping[str, str], units: str = '') -> BarChart
The RMS level each channel of a specification asks for, a bar apiece — the table's column as a picture, so which channel is loudest is seen before anything is read. No thresholds: a specification on its own has nothing to be out of (Brandon, 2026-09-06: the RMS error reading without the ±3 dB coloring).
Source code in src/visualdynamics/plot/bars.py
kurtosis_chart
¶
kurtosis_chart(plot: Any, rows: Sequence[tuple[str, float]], colors: Mapping[str, str], low: float = LOW, high: float = HIGH, changed: Callable[..., None] | None = None) -> BarChart
How Gaussian each channel is: Pearson kurtosis, a bar apiece.
Two thresholds around the nominal three, because both directions say something — above, peaks the spectrum never predicted; below, a record that has been clipped or was never random. The ordinary channels stand back in gray so the exceptions are the chart.
Every channel whatever it measures: kurtosis is dimensionless, so this is the one reading here where accelerations and forces share an axis honestly.
Source code in src/visualdynamics/plot/bars.py
snr_chart
¶
snr_chart(plot: Any, rows: Sequence[tuple[str, float]], colors: Mapping[str, str], low: float | None = None, changed: Callable[..., None] | None = None, **options: Any) -> BarChart
How far each channel's signal stands above its noise: RMS
signal-to-noise in dB, a bar apiece (core.snr, 2026-10-03).
One threshold, and it is a floor: a margin can be too small and never too large. A channel with no signal above its noise (NaN) has no bar and counts as under it — it is the worst reading there is, not a missing one. The ordinary channels stand back in gray so the weak ones are the chart, as on the kurtosis chart.
Source code in src/visualdynamics/plot/bars.py
replication_chart
¶
replication_chart(plot: Any, rows: Sequence[tuple[str, float]], colors: Mapping[str, str], which: str, low: float, high: float | None, changed: Callable[..., None] | None = None, **options: Any) -> BarChart
One reading of a transient replication, a bar per control channel.
rows is [(label, value)] already reduced to the reading wanted —
which repeat those values came from is the caller's business, and
on screen it is the one the event box is pointing at.