A Codex skill that drives an already-open OriginLab Origin / OriginPro over Windows COM Automation to build, style, and export figures - no clipboard, no manual clicking.
Verified end-to-end on Origin 64-bit (Origin 2021+) on Windows with
Python 3.12 + pywin32.
- Connects to the running Origin instance via
Origin.ApplicationSI - Writes data into a worksheet with
PutWorksheetand reads it back to verify - Creates stacked XRD patterns, bar/column, line, scatter, and line+symbol plots
- Styles axes, legends, curve colors, and text annotations through LabTalk
- Exports a PNG with
expGraphand checks the file was actually written - Never saves
.opju(you press Ctrl+S) and treats source data as read-only
skills/origin-plotting/
├── SKILL.md
├── agents/openai.yaml
├── references/
│ ├── plot-types.md
│ └── xrd-recipe.md
└── scripts/
└── origin_plot.py
git clone https://github.com/mayufei666/origin-plotting-skill.git
Copy-Item -Recurse -Force `
.\origin-plotting-skill\skills\origin-plotting `
"$env:USERPROFILE\.codex\skills\origin-plotting"Reload or restart Codex, then invoke it with $origin-plotting.
If your Codex build supports the skill-installer:
python scripts/install-skill-from-github.py `
--repo mayufei666/origin-plotting-skill `
--path skills/origin-plotting
python skills\origin-plotting\scripts\origin_plot.py `
--data "E:\data\sample.csv" `
--x-col 1 --y-cols 2,3 `
--plot-type bar `
--out "C:\OriginData\bar.png" `
--xlabel "Category" --ylabel "Value"--plot-type accepts line, scatter, line+symbol, bar.
- Windows
- OriginLab Origin / OriginPro installed and already running
- Python 3.9+ with
pywin32(pip install pywin32)
| Problem | What works here |
|---|---|
originpro package hangs |
Use raw win32com COM instead |
Origin.Application unreliable |
Use Origin.ApplicationSI |
Bar chart plot:=300 / 310 gives an empty graph |
Use plot:=203 |
| Clipboard export fails | Use LabTalk expGraph |
.opju save via COM crashes the connection |
Let the user press Ctrl+S |
| Raw color numbers fail silently | Resolve via color(r,g,b) |
| LabTalk eats parentheses in labels | Quote the annotation text |
MIT - see LICENSE.