Data Visualizer is a small Python project for generating and plotting complex-valued matrices as colorized images. It includes helpers for building sample matrices, normalizing magnitudes, combining phase and magnitude into RGB output, and rendering the result with Matplotlib.
Current release: v0.2.0
- Generates random, diagonal, and unitary complex matrices.
- Maps complex values to RGB using pluggable normalizers and combine strategies.
- Plots complex arrays in a single left-to-right row by default.
- Compares any number of arrays side by side with the same rendering pipeline.
- Uses
bar_orientationto place bars underneath each plot or to the right. - Uses
show_individual_barsto enable or disable the per-plot bars. - Uses
single_color_barto switch to a shared color-bar layout; the top-level helper defaults to the shared layout. - Can optionally overlay cell values for small arrays.
flowchart TD
A[main.py] --> B[get_array]
A --> C[plot_array]
B --> D[matrices.py]
D --> D1[RandomMatrixBuilder]
D --> D2[DiagonalMatrixBuilder]
D --> D3[UnitaryMatrixBuilder]
C --> E[ComplexColorMapper]
E --> F[normalizers.py]
E --> G[strategies.py]
C --> H[ComplexArrayPlotter]
H --> I[Matplotlib figure]
F --> F1[RationalNormalizer]
F --> F2[LinearNormalizer]
F --> F3[LogNormalizer]
G --> G1[ValueStrategy]
G --> G2[SaturationStrategy]
G --> G3[BothStrategy]
G --> G4[PhaseOnlyStrategy]
G --> G5[MagnitudeGrayStrategy]
Install the runtime dependencies:
.venv\\Scripts\\python.exe -m pip install -r requirements.txtRun the example from the repository root:
.venv\\Scripts\\python.exe main.pymain.py checks for the project virtual environment and exits if you try to run it with a different interpreter.
from api import get_array, plot_array, plot_arrays
arr = get_array(50)
plot_array(arr)
plot_arrays(arr)
plot_arrays(arr, show_individual_bars=False)
plot_arrays(arr, single_color_bar=True)
arr1 = get_array(50)
arr2 = get_array(50)
arr3 = get_array(50)
plot_arrays(arr1, arr2, arr3)You can also customize the rendering by choosing a different normalizer or combine strategy.
main.py: example entry point and virtual-environment gate.api.py: public API and convenience helpers.matrices.py: complex matrix builders.normalizers.py: magnitude normalization strategies.strategies.py: RGB combine strategies.mapper.py: complex-to-RGB conversion.plotter.py: Matplotlib rendering.
- Generated Python bytecode and IDE files are ignored by default.
- The
temp/folder is treated as scratch space and is excluded from source control.