12. Summary of flags and keywords¶
This chapter is the complete CLI reference for batplot: every --flag, positional keyword, and common file suffix. Interactive menu keys (c, p, u, …) are documented in each mode chapter — see Interactive menus — and are not listed here.
All flags use a double-dash prefix (--). Many also accept a short form (see §12.1).
Worked tutorials: 1D · EC · Operando · Histogram · Batch · Utilities.
Mode-specific terminal help:
12.1 Conventions and short aliases¶
| Form | Notes |
|---|---|
--flag |
Long form (preferred in docs). |
-i, -h, … |
Short aliases normalized to long form before parsing. |
| Keywords | Bare tokens such as allfiles — not flags. |
| File suffixes | file.xy:1.54, file:q — part of the filename token. |
| Style files | A positional .bps / .bpsg / .bpsh path applies that style (same idea as interactive i). |
Short aliases
| Short | Long |
|---|---|
-i |
--i / --interactive |
-h / --h |
--help |
-v / -V / --v |
--version |
-m / --m |
--manual |
-o |
--out |
-r |
--xrange |
-d |
--delta |
-c |
--convert |
-b |
--b (EC potential-window tolerances) |
12.2 Keywords and filename suffixes¶
These are not --flags.
Directory expansion keywords¶
| Keyword | What it does | Example |
|---|---|---|
allfiles |
Expand to every supported data file in the folder (natural sort). Overlays on one figure (or feeds a mode). Not the same as --all. |
batplot allfiles --stack --wl 0.259 --i |
all<ext>files |
Same, but only that extension (e.g. allxyfiles, allnorfiles, allcsvfiles). |
batplot allxyfiles --xaxis 2theta |
all |
With EC mode only: synonym for batching the cwd (same family as --all). Prefer --all. |
batplot --gc all --mass 7 |
Supported extensions for allfiles include .xy, .xye, .qye, .dat, .csv, .txt, .gr, .nor, .chik, .chir, .mpt, .brml, .raw, .xrdml, .rasx (CIF/session/script files are skipped).
Wavelength / Q suffixes on files¶
| Suffix | What it does | Example |
|---|---|---|
file:λ |
Treat X as 2θ at wavelength λ (Å); convert to Q for plotting (data files). On a .cif, sets λ for tick calculation. |
batplot scan.xy:1.54 --i |
file:λ1:λ2 |
2θ(λ₁) → Q → 2θ(λ₂) re-projection. | batplot TD_R02.dat:0.259:1.54 --xaxis 2theta --i |
file:q |
Mark file as already in Q (no conversion). | batplot sim.csv:q --stack --i |
Any file:λ or file:q implies Q mode unless --xaxis 2theta wins. Details: 1D — Wavelength Handling.
Positional style / session files¶
| Token | What it does |
|---|---|
style.bps / style.bpsg / style.bpsh |
Apply exported style (histogram uses .bpsh). |
session.pkl |
Reload a saved session (--i to edit). |
Several *.pkl |
Batch interactive edit of same-mode sessions — Ch.9. |
12.3 Help, version, and documentation¶
| Flag | What it does | Example |
|---|---|---|
--help / --h [topic] |
General help, or xy / ec / op / histo. |
batplot --help ec |
--version / --v |
Print version and release notes. | batplot --version |
--manual / --m |
Open the online user manual in a browser. | batplot --manual |
12.4 General figure I/O and sessions¶
| Flag | What it does | Example |
|---|---|---|
--i / --interactive |
Open the live interactive menu with the figure. | batplot file.xy --i |
--out FILE |
Save the figure and exit (extension sets format; default .svg if omitted). |
batplot file.xy --out plot.png |
--savefig FILE |
Alternate export path (same role as --out in most modes). Prefer --out in new docs. |
batplot file.xy --savefig plot.svg |
--save |
Write .pkl session(s) without opening --i (prompts for folder/name). |
batplot file.xy --xaxis 2theta --save |
--format EXT |
With --all: image type (svg, png, pdf, jpg, jpeg, eps, tif, tiff). Default svg. |
batplot --all --format png |
--all [style] |
Batch: one output per file under Figures/ (or sessions with --save). Optional style path. See Ch.9. |
batplot --all --xaxis 2theta |
--canvas |
Combine several .pkl sessions into one multi-panel canvas layout. |
batplot a.pkl b.pkl --canvas --i |
--debug |
Extra diagnostic printing (developer / troubleshooting). | batplot file.xy --debug --i |
12.5 Shared axis and display flags¶
Used across modes where they make sense.
| Flag | What it does | Example |
|---|---|---|
--xaxis TYPE |
X-axis kind or label: Q/q, 2theta, d, r, k, energy, rft, time, or a custom string. Optional for plain X/Y. |
batplot file.xy --xaxis 2theta |
--xrange MIN MAX |
Display X limits. | batplot file.xy --xrange 10 80 |
--wl λ |
Wavelength in Å (2θ↔Q and related conversions for all listed files). | batplot file.xy --wl 1.54 |
--ro |
Swap X and Y before plotting. | batplot file.csv --xaxis time --ro |
--norm |
Normalize Y to 0–1 (1D). | batplot a.xy b.xy --norm --i |
--1d / --2d |
First derivative dy/dx (1D curves, or each operando scan). --2d is an alias of --1d in operando help. |
batplot R03_Se.nor --1d --xaxis energy |
--errors |
Plot error bars when a third column is available. | batplot file.xye --errors --i |
--autoscale |
With --stack / --delta: scale vertical spacing relative to each curve’s Y range. |
batplot a.xy b.xy --stack --delta 0.2 --autoscale |
12.6 1D / XY mode¶
Default mode (no --gc / --operando / --histo / …).
| Flag | What it does | Example |
|---|---|---|
--stack |
Stack curves vertically (implies intensity normalization for stacking). | batplot a.xy b.xy --stack --i |
--delta N |
Stack spacing (default depends on --stack). |
batplot a.xy b.xy --stack --delta 0.15 |
--ry |
Plot the preceding file(s) on the right Y-axis (disables --stack). Repeatable pattern. |
batplot left.xy --ry right.xy --i |
--txaxis |
With --ry: right-Y curves use the top X-axis (default: shared bottom X). |
batplot a.xy --ry b.xy --txaxis --i |
--chik |
EXAFS χ(k) labeling / weighting mode. | batplot data.chik --chik --i |
--kchik |
Plot k·χ(k). | batplot data.chik --kchik --i |
--k2chik |
Plot k²·χ(k). | batplot data.chik --k2chik --i |
--k3chik |
Plot k³·χ(k). | batplot data.chik --k3chik --i |
--fullprof XSTART XEND XSTEP [λ] |
FullProf-style row-wise .dat overlay (start, end, step; optional wavelength). |
batplot pattern.dat --fullprof 10 80 0.02 1.54 --i |
CIF reference ticks: pass .cif paths (optionally phase.cif:λ) together with data files — see 1D — CIF.
12.7 Column selection (--readcol…)¶
Default 1D plotting uses columns 1 and 2 (1-indexed).
| Flag | What it does | Example |
|---|---|---|
--readcol X Y … |
Global or per-file X/Y (repeat pairs for multi-curve; Y1-Y2 range shorthand in help). |
batplot f.dat --readcol 1 3 --i |
--readcolxy X Y |
Only for .xy files. |
batplot a.xy --readcolxy 1 2 |
--readcolxye X Y |
Only for .xye. |
|
--readcolqye X Y |
Only for .qye. |
|
--readcolnor X Y |
Only for .nor. |
|
--readcoldat X Y |
Only for .dat. |
|
--readcolcsv X Y |
Only for .csv. |
|
--readcol<ext> X Y |
Any custom extension (e.g. --readcolafes 2 3 for .afes). |
batplot f.afes --readcolafes 2 3 |
--readcolc X Y |
Operando contour scan columns. | batplot --operando --readcolc 1 2 --i |
--readcols X Y |
Operando EC side-panel columns. | batplot --operando --readcols 1 2 --i |
Per-file placement: put --readcol after the file it applies to when mixing files. Details: 1D — readcol · Utilities.
12.8 Utilities: preview, strip, convert, Bruker extract¶
Full walkthroughs: Ch.11 Utilities.
| Flag | What it does | Example |
|---|---|---|
--showcol |
Print column names / first values; then exit. | batplot --showcol demo_cols.txt |
--strip-header N |
Copy files with first N lines removed → stripped/ (originals untouched). |
batplot demo_cols.txt --strip-header 2 |
--convert FROM TO |
Convert XRD X among 2θ / Q / d (or λ₁→λ₂); write converted/. |
batplot clean.xy --convert 1.54 q |
--convert-ext EXT |
Force output extension for --convert (default .qye for Q, else .xy). |
batplot f.xy --convert 1.54 q --convert-ext .qye |
--ext EXT[,EXT…] |
With folder + --convert / --strip-header: only these extensions. |
batplot folder --ext .xy --convert 0.26 q |
--extract-brml-scans [OUT_DIR] |
Split a Bruker .brml into per-scan .xy files. |
batplot run.brml --extract-brml-scans |
--convert tokens: a number means 2θ at that λ (Å); units q/d/2theta (aliases 2th, tth, …). Matrix: Convert XRD files.
12.9 Electrochemistry (GC / CV / dQ/dV / CPC / EPC)¶
| Flag | What it does | Example |
|---|---|---|
--gc |
Galvanostatic cycling (potential vs capacity). | batplot B443.csv --gc --i |
--cv |
Cyclic voltammetry (potential vs current). | batplot file.mpt --cv --i |
--dqdv |
Differential capacity dQ/dV vs potential. | batplot B443.csv --dqdv --i |
--cpc |
Capacity per cycle + coulombic efficiency. | batplot B443.csv --cpc --i |
--epc |
Energy per cycle (when supported by the file). | batplot file.csv --epc --i |
--mass M |
Active mass in mg (or grams with a g suffix, e.g. 0.0065g). Repeatable for per-file mass. Required for many .mpt workflows. |
batplot a.mpt --mass 6.5 --gc --i |
--cum |
With --gc: cumulative (throughput) capacity — charge/discharge laid end-to-end. |
batplot file.csv --gc --cum --i |
--pw VMIN VMAX |
Potential-window custom GC from potential–time data (use with --cd). |
batplot cell.mpt --gc --pw 0.01 3 --cd 0.2 --i |
--cd RATE |
Current density (mA/g) for --pw capacity calculation. |
(with --pw) |
--b TOL_UP TOL_LO |
Boundary tolerances (V) for --pw edge detection (defaults ~0.05 / 0.005). |
batplot cell.mpt --gc --pw 0.01 3 --cd 0.2 --b 0.05 0.005 |
--anode / --cathode |
Select anode- vs cathode-oriented parsing for indexed voltage–time custom GC. | batplot cell.mpt --gc --anode --pw … --cd … |
--xaxis time |
Time (h) vs potential from Neware CSV / Biologic MPT (no --gc required). |
batplot B443.csv --xaxis time --i |
Batch EC: batplot --all --gc --mass 7 — Ch.9.
12.10 Operando / contour mode¶
| Flag | What it does | Example |
|---|---|---|
--operando |
Contour map from a folder of sequential scans (+ optional EC side panel). | batplot --operando --i |
--contour |
Alias for --operando. |
batplot --contour --wl 1.54 --i |
--wl λ |
Convert scan X from 2θ to Q. | batplot --operando --wl 1.54 --i |
--xaxis … |
Force axis type (e.g. 2theta, Q). |
batplot --operando --xaxis 2theta --i |
--1d / --2d |
Contour of dy/dx for each scan. | batplot --operando --1d --i |
--average N |
Average every N consecutive scans before contouring. | batplot --operando --average 2 --i |
--sum N |
Sum every N consecutive scans (not both with --average). |
batplot --operando --sum 2 --i |
--readcolc X Y |
Columns for contour scans. | batplot --operando --readcolc 1 2 --i |
--readcols X Y |
Columns for EC side panel. | batplot --operando --readcols 1 2 --i |
Pass a folder path and/or .cif files on the command line as needed.
12.11 Histogram mode¶
| Flag | What it does | Example |
|---|---|---|
--histo |
Histogram mode (tabular .csv / .txt). |
batplot sizes.csv --histo --i |
--histocol N |
Column to bin (1-indexed). With --i and no column, a wizard lists columns. |
batplot sizes.csv --histo --histocol 2 --bins 10 |
--binwidth W |
Bin width. | batplot sizes.csv --histo --histocol 2 --binwidth 0.5 |
--bins N |
Number of equal-width bins (alternative to --binwidth). |
batplot sizes.csv --histo --histocol 2 --bins 40 |
--xrange A B |
Histogram display / data window. | batplot sizes.csv --histo --histocol 2 --xrange 0 16 |
Batch: batplot --all --histo --histocol 2 (requires --histocol). Style files use .bpsh.
12.12 Alphabetical flag index¶
| Flag | Section |
|---|---|
--1d / --2d |
12.5, 12.10 |
--all |
12.4 |
--anode / --cathode |
12.9 |
--autoscale |
12.5 |
--average |
12.10 |
--b |
12.9 |
--bins / --binwidth |
12.11 |
--canvas |
12.4 |
--cd |
12.9 |
--chik / --kchik / --k2chik / --k3chik |
12.6 |
--contour |
12.10 |
--convert / --convert-ext |
12.8 |
--cpc / --cv / --cum |
12.9 |
--debug |
12.4 |
--delta |
12.6 |
--dqdv |
12.9 |
--epc |
12.9 |
--errors |
12.5 |
--ext |
12.8 |
--extract-brml-scans |
12.8 |
--format |
12.4 |
--fullprof |
12.6 |
--gc |
12.9 |
--help / --h |
12.3 |
--histo / --histocol |
12.11 |
--i / --interactive |
12.4 |
--manual / --m |
12.3 |
--mass |
12.9 |
--norm |
12.5 |
--operando |
12.10 |
--out |
12.4 |
--pw |
12.9 |
--readcol… |
12.7 |
--ro |
12.5 |
--ry / --txaxis |
12.6 |
--save / --savefig |
12.4 |
--showcol |
12.8 |
--stack |
12.6 |
--strip-header |
12.8 |
--sum |
12.10 |
--version / --v |
12.3 |
--wl |
12.5 |
--xaxis / --xrange |
12.5 |
Keywords / suffixes: §12.2 (allfiles, all<ext>files, file:λ, file:λ1:λ2, file:q, style/session paths).