visualdynamics.viz.mac_bars¶
mac_bars
¶
The MAC matrix as 3-D bars, where both height and color are the value.
The flat grid shows which pairs match at a glance. The bars show what the grid shows poorly, how much the near matches differ, which in color alone is a judgment of shade; as heights, a 0.6 next to a 0.9 is a visible step. The scale is fixed at 0 to 1, as in the flat grid and the coherence map, because a MAC is a bounded ratio.
The bars are one mesh whatever the mode count, as in the waterfall: a 139 by 139 cross-MAC is 19 321 boxes and still one actor. Rows are the first set's modes and columns the second's, labeled by frequency as the flat grid's axes are, and thinned past the same label limit. Row 0 is nearest the viewer: the flat grid reads down from the top left, and the camera puts the same first mode in front.
Functions:
| Name | Description |
|---|---|
cell_to_pair |
Which (row, column) a picked cell of the bars mesh belongs to, for |
add_mac_bars |
Draw the MAC bars into a plotter: one mesh, the frequency labels |
place_camera |
Place the camera at the bars' home view for a |
mac_bars_scene |
Build a PyVista plotter showing the MAC bars ( |
Functions:¶
cell_to_pair
¶
Which (row, column) a picked cell of the bars mesh belongs to, for
a matrix with columns columns.
The bars mesh is built box by box, six faces each, in row-major order, and this inverts that order. Picking depends on the two staying in step.
Source code in src/visualdynamics/viz/mac_bars.py
add_mac_bars
¶
add_mac_bars(plotter: Any, frequencies: Sequence[float], matrix: Any, column_frequencies: Sequence[float] | None = None, theme: Any = None, selected: Sequence[tuple[int, int]] = (), active: tuple[int, int] | None = None, matched: Sequence[tuple[int, int]] = ()) -> dict[str, Any]
Draw the MAC bars into a plotter: one mesh, the frequency labels and the 0 to 1 axis.
frequencies label the rows, and column_frequencies the columns
(the same as the rows when None). The marks match the flat grid's.
selected pairs get a blue outline traced around their bar, and the
active (animated) pair, when it is one of them, a heavier one.
matched pairs, already committed to the matched-modes table, get a
red checker on the top and the four sides of their bar. Every bar
has a thin black outline when neither side of the grid is over
OUTLINE_LIMIT.
Returns {'rows', 'columns', 'named_rows', 'named_columns'}; the named lists say which modes got a frequency label.
Raises ValueError when the frequency counts do not match the matrix's rows and columns.
Source code in src/visualdynamics/viz/mac_bars.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | |
place_camera
¶
Place the camera at the bars' home view for a rows by columns
matrix: row 0 nearest, columns left to right.
The window calls this when the comparison changes and at no other time, as for every scene. The view is from the front left, and high enough that a full-height bar does not hide the far edge.
Source code in src/visualdynamics/viz/mac_bars.py
mac_bars_scene
¶
mac_bars_scene(frequencies: Sequence[float], matrix: Any, column_frequencies: Sequence[float] | None = None, plotter: Any = None, off_screen: bool = False, theme: Any = None) -> Any
Build a PyVista plotter showing the MAC bars (add_mac_bars), or
add them to plotter, with the camera at the home view. Returns the
plotter, to .show(), or to .screenshot() when it is off
screen.