A cross-platform scientific data analysis and graphing GUI.
GraphMatrix aims to be a Python-first, open alternative to tools like OriginPro: typed worksheet columns, publication-quality 2D graphs, a real analysis toolkit, and scriptable automation. It targets Windows, macOS, and Linux from a single codebase.
Status: M1–M10 functionally implemented (M0 skeleton + worksheets, 2D graphs, analysis, export, scripting, M7 graph-interaction, M8 provenance/journal output, M9 digitizer + command palette, and M10 analysis-depth + colour-mapped/heatmap/ contour plots + 3D scatter/surface on PyVista) plus the M11 start — linked brushing between worksheets and graphs. See
PLAN.md§0 for an honest per-milestone status, andROADMAP.mdfor what comes next.GraphMatrix is still in active development. APIs, file formats, and UI details may change between releases; please report issues and back up your projects.
Complex figures rendered by GraphMatrix: layout templates, multi-panel grids, shared-X stacks with hidden Y axes, dual axes, and side-by-side twins.
git clone https://github.com/hitaishi2222/GraphMatrix.git
cd GraphMatrix
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev,mcp]"
graphmatrix- Python 3.10+
- PySide6, NumPy, SciPy, matplotlib, pyqtgraph, lmfit, openpyxl, pyarrow
- Optional: h5py (HDF5), fastmcp (MCP server)
python -m venv .venv && source .venv/bin/activate
pip install -r requirements-dev.txt
# run the app
PYTHONPATH=src python -m graphmatrix
# run the tests (core only, no GUI required)
pytestOr install as a package:
pip install -e ".[dev]"
graphmatrixsrc/graphmatrix/
core/ Qt-free engine: model, commands, project I/O, analysis, scripting
ui/ PySide6 views: main window, panels, graph editor, dialogs, console
plugins/ Drop-in plugins discovered at startup
tests/ Core + analysis + I/O + export + scripting + headless UI tests
examples/ Sample scripts and projects
packaging/ PyInstaller spec + build script
docs/ Usage and packaging guides
.github/ CI matrix (Windows/macOS/Linux)
The golden rule: core/ never imports PySide6. That keeps the engine
testable, headless-batchable, and free to be accelerated later without touching the UI.
- Worksheets — typed columns (X/Y/YErr/Z/label/group/date/text), units, comments, masking, formulas, editable grid, undoable copy/paste, row/column operations, column drag-reorder, drag-and-drop file import.
- Import/export — CSV/TSV, Excel, Parquet, HDF5; export worksheets to CSV.
- Graphs — multi-layer 2D; line/scatter/line+symbol/bar/area/step/error-bar; dashed/dotted line styles; horizontal & vertical reference lines; hover crosshair and nearest-point readout; secondary (dual) Y axis; text annotations; editable axes and legend; style templates; drag a column from the tree to plot it; live-linked to data.
- Graph layout types — Simple, Stack (vertical panels), Stacked line (one band per curve, for curves that share an X axis but not a scale), Double Y (2Y), X-Twin (side-by-side) and Grid (R×C), selectable from Graph → Graph Type, the toolbar, the project tree's right-click menu, or Properties. The sidebar shows only the fields that type uses — grid rows/columns and panel gaps for a grid, Y-delta for a stack, band pitch for a stacked line, and so on — and changes are undoable.
- Trend instead of absolute values — a layer's Y mode can be Normalized (0-1): the curve is scaled to its own range, so its shape is readable whatever the absolute values are. The worksheet data is never touched; the readout still reports the real numbers.
- Analysis — descriptive stats, linear/polynomial regression, nonlinear fitting (Gaussian, Lorentzian, exponential, sinusoid, sigmoid, … via lmfit), peak finding, peak deconvolution (multi-peak Gaussian/Lorentzian), slope over an X range, FFT, smoothing, filters, baseline correction (polynomial/linear/ALS/rolling-ball/ rubber-band/median), derivative/integral/interpolation, t-tests, ANOVA, correlation, histogram.
- Recipes — save an analysis and re-run it on any series, or batch it across many files.
- Provenance & reproducibility — GraphMatrix records what you did in plain language
(Tools → Analysis Methods…) and exports an analysis bundle (project + data
CSVs + figures +
reproduce.py+methods.md) that rebuilds every figure. - Digitizing — recover an
(x, y)curve from a picture of a plot (Analyze → Digitize Curve from Image…): calibrate with two anchors per axis, then extract by darkness or by colour. - Journal presets — one-click Nature/Science/APS/IEEE figure sizes and typography (Graph → Journal Preset), honoured by the exporter.
- Command palette —
Ctrl+Shift+Pfuzzy-searches and runs any action. - Publication export — PDF/SVG/EPS/PNG/TIFF via matplotlib, sized in mm at your DPI, dual-axis + annotations, and batch export of every graph in the project.
- Automation — embedded Python console, macro recording → runnable script, batch import, and a batch analysis pipeline (recipe → per-file report + figure).
- Appearance — six theme presets (Classic/Modern × Dark/Light, plus shadcn Dark/Light) with matching plot-canvas colours, switchable from View → Theme and remembered between runs.
- Preferences — View → Preferences… (
Ctrl+,) holds the theme, the decimals of new columns, theCtrl+wheel zoom, the default export format / DPI / size, and whether unsaved changes may be discarded silently. - Discoverability — the toolbar shows an icon and a label for every action (and its shortcut in the tooltip), the welcome page lists the shortcuts worth knowing, and F1 opens a searchable list of all of them.
GraphMatrix ships a small CLI for scripting and headless use:
graphmatrix --help
graphmatrix run project.rsproj # open project(s) in the GUI
graphmatrix list project.rsproj # list graphs in a project
graphmatrix export project.rsproj -g 1,3-5 --format pdf --out ./out
graphmatrix run pipeline.yaml # run a headless YAML pipeline
graphmatrix doctor # check environment and dependenciesrunopens one or more project files in the GUI.listprints the graphs available in a project (1-based indices).exportexports all or selected graphs (1,1,3,1-3,(1,3)).doctorverifies Python, required/optional modules, and the display environment.- Pipelines are YAML files with steps:
import,column,graph,plot,fit,analyze,export,save, andcode.
GraphMatrix exposes an MCP server for AI assistants. Install the optional extra first:
pip install "graphmatrix[mcp]"There are two ways to run it:
- Client-launched stdio (recommended): point your client at the
graphmatrix-mcpcommand. The client starts and stops the server itself; GraphMatrix needs no in-app server UI. - Port-based server: run it yourself when several clients should share one endpoint.
graphmatrix-mcp # stdio (clients launch this)
graphmatrix-mcp --transport http --port 8765 # port-based serverClient config:
{ "mcpServers": { "graphmatrix": { "command": "graphmatrix-mcp" } } }{ "mcpServers": { "graphmatrix-live": { "url": "http://127.0.0.1:8765/mcp" } } }The live bridge. A running GraphMatrix window always listens on a local
Unix socket (~/.local/state/graphmatrix/ipc-<pid>.sock). The live tools use it
to edit the open project: the changes appear at once, are undoable with
Ctrl+Z, and are visible in the window. No server UI or configuration is
involved — the bridge is part of the application, not of the MCP server.
Tools: connect, summary (workbooks, sheets, graphs, layout types, and project
versions), run (Python against the GraphMatrix API — including pipelines,
versioning, batch statistics, colour/XYZ plots, numeric fit regions via
api.fit(..., x_min=..., x_max=...), and live data tailing via
graphmatrix.core.live.LiveFileSource), export, and the live tools that
drive the running GUI over its local IPC bridge:
| Live tool | What it does |
|---|---|
live_summary |
Quick map of the open project (workbooks, sheets, graphs). |
live_describe |
Detailed map: every column with its type, which X/Y pairs are plottable, every graph with its panels and series, plus the supported graph types and plot styles. |
live_add_data |
Create a worksheet and fill it with columns (literal values or a generator such as linspace/sin/random). |
live_create_graph |
Create a graph of any template — simple, stack, stack-line, double-y, x-twin, grid — with its first series, and open it as a tab. |
live_add_plot |
Add a series to a specific panel (1-based); y_axis="right" for the secondary axis, replace=True to clear the panel first. |
live_set_graph_type |
Switch a graph's template or resize its panel grid. |
live_set_property |
Set graph properties (title, panel_gap_x, y_delta, …) or panel properties (x_label, y_label, y2_label, x_scale, show_y_axis, …). |
live_delete_graph |
Remove a graph (undoable in the GUI). |
live_save / live_export |
Save the project / export graphs to PDF, SVG, PNG, … (same theme and proportions as the preview). |
live_run / live_open / live_screenshot |
Raw Python against the live project, open a project file, capture the window. |
Live edits go through the GUI's own command stack: they appear at once, are
undoable with Ctrl+Z, and never touch a file behind your back.
A ready-made skill for assistants lives in
.agents/skills/graphmatrix-mcp/SKILL.md;
examples/mcp_live_demo.py runs the whole workflow against a running window.
- Import: CSV/TSV, Excel (
.xlsx/.xls), Parquet, HDF5/NetCDF (optional) - Export: PDF, SVG, EPS, PNG, TIFF, JPEG (sized in mm at your DPI, and drawn with the same theme, grid, title and legend as the on-screen preview)
- 3D plotting (live scene): optional extra —
pip install pyvista pyvistaqt
Ctrl+NNew project ·Ctrl+OOpen ·Ctrl+SSaveCtrl+Z/Ctrl+Shift+ZUndo / RedoCtrl+Shift+PCommand palette ·F1All keyboard shortcutsCtrl+WClose tab ·Ctrl+EExport the active graph ·Ctrl+,PreferencesCtrl+=/Ctrl+-/Ctrl+0Zoom in / out / fit the active panelF2Rename selected object / columnCtrl+Alt+N/Ctrl+Alt+CAdd row / column at the end of the active sheetCtrl+Alt+=Insert rows above the selectionCtrl+Alt+-/Ctrl+Alt+Shift+-Delete selected rows / columns
Help → Keyboard Shortcuts… shows the full, searchable list. On macOS the
Ctrl keys are the Command key.
- Hyprland / Wayland: GraphMatrix sets its app id to
graphmatrixso it tiles. If your compositor still floats it, check window rules matchingpython3orgraphmatrix. - Headless tests: run with
QT_QPA_PLATFORM=offscreen. - Missing optional deps: run
graphmatrix doctor.
Contributions are welcome. Please open an issue or pull request. Keep core/ free of PySide6
imports so the engine stays testable and headless.
Before pushing, run the same gates as CI:
make test # QT_QPA_PLATFORM=offscreen pytest
make lint # ruff check + ruff format --check + mypyruff covers the whole tree; mypy is a ratchet over the modules that are type-clean
today (see [tool.mypy] files in pyproject.toml) — widen it as packages reach zero.
Logs go to ~/.local/state/graphmatrix/graphmatrix.log; set GRAPHMATRIX_LOG_LEVEL=DEBUG
to see the exceptions the UI deliberately swallows.
MIT (see LICENSE if present).
PLAN.md— architecture, decisions, milestones, current status, risks.ROADMAP.md— forward plan: backlog by area, M7+ sequencing.docs/USAGE.md— how to use every feature, with scripting examples.docs/PACKAGING.md— building and signing distributable bundles.



