batplot 1.8.29__tar.gz → 1.8.31__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. {batplot-1.8.29/batplot.egg-info → batplot-1.8.31}/PKG-INFO +75 -47
  2. {batplot-1.8.29 → batplot-1.8.31}/README.md +74 -46
  3. {batplot-1.8.29 → batplot-1.8.31}/batplot/__init__.py +1 -1
  4. {batplot-1.8.29 → batplot-1.8.31}/batplot/args.py +35 -12
  5. {batplot-1.8.29 → batplot-1.8.31}/batplot/batch.py +31 -11
  6. {batplot-1.8.29 → batplot-1.8.31}/batplot/batplot.py +98 -57
  7. {batplot-1.8.29 → batplot-1.8.31}/batplot/converters.py +3 -1
  8. {batplot-1.8.29 → batplot-1.8.31}/batplot/cpc_interactive.py +146 -8
  9. batplot-1.8.31/batplot/data/CHANGELOG.md +95 -0
  10. {batplot-1.8.29 → batplot-1.8.31}/batplot/data/USER_MANUAL.md +4 -3
  11. {batplot-1.8.29 → batplot-1.8.31}/batplot/dev_upgrade.py +4 -2
  12. {batplot-1.8.29 → batplot-1.8.31}/batplot/electrochem_interactive.py +367 -126
  13. {batplot-1.8.29 → batplot-1.8.31}/batplot/manual.py +12 -1
  14. {batplot-1.8.29 → batplot-1.8.31}/batplot/modes.py +23 -3
  15. {batplot-1.8.29 → batplot-1.8.31}/batplot/operando.py +167 -142
  16. {batplot-1.8.29 → batplot-1.8.31}/batplot/operando_ec_interactive.py +16 -16
  17. {batplot-1.8.29 → batplot-1.8.31}/batplot/readers.py +482 -50
  18. {batplot-1.8.29 → batplot-1.8.31}/batplot/session.py +70 -0
  19. {batplot-1.8.29 → batplot-1.8.31}/batplot/version_check.py +2 -5
  20. {batplot-1.8.29 → batplot-1.8.31/batplot.egg-info}/PKG-INFO +75 -47
  21. batplot-1.8.31/batplot.egg-info/top_level.txt +2 -0
  22. {batplot-1.8.29 → batplot-1.8.31}/pyproject.toml +2 -2
  23. batplot-1.8.31/setup.py +3 -0
  24. batplot-1.8.29/batplot/data/CHANGELOG.md +0 -70
  25. batplot-1.8.29/batplot.egg-info/top_level.txt +0 -1
  26. batplot-1.8.29/setup.py +0 -3
  27. {batplot-1.8.29 → batplot-1.8.31}/LICENSE +0 -0
  28. {batplot-1.8.29 → batplot-1.8.31}/MANIFEST.in +0 -0
  29. {batplot-1.8.29 → batplot-1.8.31}/NOTICE +0 -0
  30. {batplot-1.8.29 → batplot-1.8.31}/batplot/cif.py +0 -0
  31. {batplot-1.8.29 → batplot-1.8.31}/batplot/cli.py +0 -0
  32. {batplot-1.8.29 → batplot-1.8.31}/batplot/color_utils.py +0 -0
  33. {batplot-1.8.29 → batplot-1.8.31}/batplot/config.py +0 -0
  34. {batplot-1.8.29 → batplot-1.8.31}/batplot/interactive.py +0 -0
  35. {batplot-1.8.29 → batplot-1.8.31}/batplot/plotting.py +0 -0
  36. {batplot-1.8.29 → batplot-1.8.31}/batplot/style.py +0 -0
  37. {batplot-1.8.29 → batplot-1.8.31}/batplot/ui.py +0 -0
  38. {batplot-1.8.29 → batplot-1.8.31}/batplot/utils.py +0 -0
  39. {batplot-1.8.29 → batplot-1.8.31}/batplot.egg-info/SOURCES.txt +0 -0
  40. {batplot-1.8.29 → batplot-1.8.31}/batplot.egg-info/dependency_links.txt +0 -0
  41. {batplot-1.8.29 → batplot-1.8.31}/batplot.egg-info/entry_points.txt +0 -0
  42. {batplot-1.8.29 → batplot-1.8.31}/batplot.egg-info/requires.txt +0 -0
  43. {batplot-1.8.29 → batplot-1.8.31}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: batplot
3
- Version: 1.8.29
3
+ Version: 1.8.31
4
4
  Summary: Interactive plotting tool for material science (1D plot) and electrochemistry (GC, CV, dQ/dV, CPC, operando) with batch processing
5
5
  Author-email: Tian Dai <tianda@uio.no>
6
6
  License: MIT License
@@ -57,9 +57,10 @@ Dynamic: license-file
57
57
 
58
58
  ## Features
59
59
 
60
- - **Electrochemistry Modes**: Galvanostatic cycling (GC), cyclic voltammetry (CV), differential capacity (dQdV), capacity per cycle (CPC) with multi-file support
61
- - **Normal xy plot**: Designed for XRD, PDF, XAS (XANES/EXAFS) but also support other types
62
- - **Operando Analysis**: Correlate in-situ characterizations (XRD/PDF/XAS) with electrochemical data
60
+ With a single line of command to easily plot publication-ready plots with customized, intuitive interactive editing features such as:
61
+ - **Electrochemistry Plot**: Galvanostatic cycling (GC), cyclic voltammetry (CV), differential capacity (dQdV), capacity per cycle (CPC) with multi-file support
62
+ - **1D XY plot**: Designed for XRD, PDF, XAS (XANES/EXAFS) but also support other types
63
+ - **Operando Contour plot**: Correlate in-situ characterizations (XRD/PDF/XAS) with electrochemical data
63
64
  - **Interactive plotting**: Real-time editing customized for each type of plottings
64
65
  - **Session Persistence**: Save and reload complete plot states with `.pkl` files
65
66
  - **Style Management**: Import/export plot styles as `.bps`/`.bpsg` files
@@ -69,11 +70,14 @@ Dynamic: license-file
69
70
 
70
71
  ```bash
71
72
  pip install batplot
73
+ # It is recommended to use separate environment for batplot to aviod compatability issues with dependencies.
72
74
  ```
73
75
 
74
76
  ## Quick Start
75
77
 
76
- Tutorial: https://drive.google.com/file/d/1NTFJWNBbWW4mgz0H5ZelGjuOBWxoFgkr/view
78
+ - Tutorial: https://drive.google.com/file/d/1NTFJWNBbWW4mgz0H5ZelGjuOBWxoFgkr/view
79
+ - Tutorial files: https://github.com/chem-plot/batplot/blob/main/batplot_tutorial.zip
80
+ - Manual: https://github.com/chem-plot/batplot/blob/main/batplot_user_manual.pdf
77
81
 
78
82
  ---
79
83
 
@@ -88,12 +92,12 @@ In batplot, --xaxis is frequently used to indicate the data type.
88
92
  # Specify X-axis type (Q, 2theta, r, k, energy, time or any user defined names)
89
93
  # By defauly, batplot will skip the header lines, plot the first and second columns as x and y
90
94
  # Q and q are equivalent (case-insensitive)
91
- batplot pattern.xye --xaxis 2theta
92
- batplot data.qye --xaxis q
93
- batplot data.txt --xaxis whatever
95
+ batplot pattern.xye --xaxis 2theta --i
96
+ batplot data.qye --xaxis q --i
97
+ batplot data.txt --xaxis whatever --i
94
98
 
95
99
  # Set X-axis range
96
- batplot pattern.xye --xaxis 2theta --xrange 10 80
100
+ batplot pattern.xye --xaxis 2theta --xrange 10 80 --i
97
101
 
98
102
  # Save to file (default .svg if no extension)
99
103
  batplot pattern.xye --xaxis 2theta --out figure
@@ -104,10 +108,10 @@ batplot pattern.txt --xaxis Energy --out figure.png
104
108
 
105
109
  ```bash
106
110
  # Convert 2θ to Q using wavelength (Å), --xaxis is no longer needed as providing wavelength is implying that user wants to convert and plot the data in Q space
107
- batplot data.raw --wl 1.5406
111
+ batplot data.raw --wl 1.5406 --i
108
112
 
109
113
  # Per-file wavelength: file.xye:1.54, in this case --xaxis is also not needed and files will be plotted in Q space
110
- batplot scan1.brml:1.5406 scan2.xye:0.7093
114
+ batplot scan1.brml:1.5406 scan2.xye:0.7093 --i
111
115
 
112
116
  # Convert and export to converted/ subfolder (q and Q equivalent)
113
117
  batplot data.xye --convert 1.54 q
@@ -122,40 +126,40 @@ batplot f1.txt --readcol 2 3 f2.txt --readcol 5 6 --convert 1.54 q
122
126
 
123
127
  ```bash
124
128
  # Stack curves vertically (auto-normalizes)
125
- batplot file1.xy file2.xy --stack
129
+ batplot file1.xy file2.xy --stack --i
126
130
 
127
131
  # Control spacing between stacked curves
128
132
  batplot file1.xy file2.xy --stack --delta 0.15
129
133
 
130
134
  # Normalize intensity to 0–1 (without stacking)
131
- batplot file.xy --norm
135
+ batplot file.xy --norm --i
132
136
  ```
133
137
 
134
138
  ### Dual y-axis (right y-axis)
135
139
 
136
140
  ```bash
137
141
  # Plot selected files on the right y-axis (--ry disables --stack)
138
- batplot file1.xy --ry file2.xy --ry file3.xy file4.xy --ry --interactive
142
+ batplot file1.xy --ry file2.xy --ry file3.xy file4.xy --ry --i
139
143
  # Files 1, 2, 4 use right y-axis; file 3 uses left y-axis
140
144
 
141
145
  # With --txaxis: right y-axis curves use the top x-axis (default: shared bottom x)
142
- batplot file1.xy --ry file2.xy --txaxis --interactive
146
+ batplot file1.xy --ry file2.xy --txaxis --i
143
147
  ```
144
148
 
145
149
  ### Column selection and multi-curve
146
150
 
147
151
  ```bash
148
152
  # Read columns 2 and 3 as X, Y (1-indexed)
149
- batplot data.xy --readcol 2 3
153
+ batplot data.xy --readcol 2 3 --wl 1.54 --i
150
154
 
151
155
  # Per-file columns
152
- batplot file1.xy --readcol 2 3 file2.xy --readcol 4 5
156
+ batplot file1.xy --readcol 2 3 file2.xy --readcol 4 5 --xaxis r --i
153
157
 
154
158
  # Multiple curves from same file (cols 1,2 and 1,3)
155
- batplot data.xy --readcol 1 2 1 3
159
+ batplot data.xy --readcol 1 2 1 3 --xaxis 2theta --i
156
160
 
157
161
  # Range: col 1 as x, cols 2–20 as 19 y-curves
158
- batplot file.txt --readcol 1 2-20
162
+ batplot file.txt --readcol 1 2-20 --xaxis Energy --i
159
163
 
160
164
  # With --convert: use custom columns when converting XRD data
161
165
  batplot data.csv --readcol 3 4 --convert 1.54 q
@@ -165,10 +169,10 @@ batplot data.csv --readcol 3 4 --convert 1.54 q
165
169
 
166
170
  ```bash
167
171
  # Plot first derivative (dy/dx)
168
- batplot file.xy --1d --stack
172
+ batplot file.xy --1d --stack --i
169
173
 
170
174
  # EXAFS k-weighting
171
- batplot data.chik --chik # χ(k)
175
+ batplot data.chik --chik --i # χ(k)
172
176
  batplot data.chik --k2chik # k²χ(k), most common
173
177
  batplot data.chik --k3chik --xrange 2 12
174
178
  ```
@@ -177,9 +181,9 @@ batplot data.chik --k3chik --xrange 2 12
177
181
 
178
182
  ```bash
179
183
  # Open interactive menu for styling, ranges, export, session save
180
- batplot pattern.xye --interactive
181
- batplot file1.xy file2.xy --stack --interactive
182
- batplot allfiles --xaxis 2theta --xrange 15 75 --interactive
184
+ batplot pattern.xye --i
185
+ batplot file1.xy file2.xy --stack --i
186
+ batplot allfiles --xaxis 2theta --xrange 15 75 --i
183
187
  ```
184
188
 
185
189
  ---
@@ -197,75 +201,96 @@ GC mode plots potential vs. capacity for each charge/discharge cycle—the prima
197
201
 
198
202
  ```bash
199
203
  # From .csv (capacity in file)
200
- batplot battery.csv --gc
204
+ batplot battery.csv --gc --i
201
205
 
202
206
  # From .mpt (requires --mass in mg)
203
- batplot battery.mpt --gc --mass 7.0
207
+ batplot battery.mpt --gc --mass 7.0 --i
204
208
 
205
- # With interactive menu
206
- batplot battery.csv --gc --interactive
207
209
  ```
208
210
 
209
211
  ### Cyclic voltammetry (CV)
210
212
 
211
213
  ```bash
212
- batplot cyclic.mpt --cv
213
- batplot cyclic.mpt --cv --interactive
214
+ batplot cyclic.mpt --cv --i
215
+ batplot cyclic.mpt --cv --i
214
216
  ```
215
217
 
216
218
  ### Differential capacity (dQ/dV)
217
219
 
218
220
  ```bash
219
- batplot battery.csv --dqdv
220
- batplot battery.csv --dqdv --interactive
221
+ batplot battery.csv --dqdv --i
221
222
  ```
222
223
 
223
224
  ### Capacity per cycle (CPC)
224
225
 
225
226
  ```bash
226
227
  # Single file
227
- batplot stability.csv --cpc
228
- batplot stability.mpt --cpc --mass 5.4
228
+ batplot stability.csv --cpc --i
229
+ batplot stability.mpt --cpc --mass 5.4 --i
229
230
 
230
231
  # Multiple files with individual colors
231
- batplot file1.csv file2.mpt --cpc --mass 6.0 --interactive
232
+ batplot file1.csv file2.mpt --cpc --mass 6.0 --i
232
233
  ```
233
234
 
234
235
  ### Time vs potential
235
236
 
236
237
  ```bash
237
238
  # Plot time (h) vs potential from CSV/MPT
238
- batplot battery.csv --xaxis time --interactive
239
+ batplot battery.csv --xaxis time --i
239
240
  ```
240
241
 
241
242
  ### Potential window (custom potential–time .mpt)
242
243
 
243
244
  ```bash
244
245
  # Two columns: potential, time. Use --pw and --cd to plot as GC
245
- batplot custom.mpt --gc --pw 0.01 3 --cd 0.2 --interactive
246
+ batplot custom.mpt --gc --pw 0.01 3 --cd 0.2 --i
246
247
  ```
247
248
 
248
249
  ---
249
250
 
250
251
  ## Operando Mode
251
252
 
253
+ Contour plots from a folder of diffraction data, optionally with an electrochemistry side panel.
254
+
255
+ ### Bruker operando (.brml)
256
+
257
+ For Bruker operando XRD (multi-scan .brml files named cyc1, cyc2, cyc3, etc.):
258
+
259
+ ```bash
260
+ # Place .brml files (e.g. RA_O5_cyc1.brml, RA_O5_cyc2.brml) in the folder
261
+ # Use --wl for Q conversion (e.g. synchrotron λ=0.709 Å)
262
+ batplot RA_O5 --operando --wl 0.709 --i
263
+
264
+ # EC side panel: .mpt or Biologic DataLogger CSV (*--DataLogger.csv), sorted by cyc
265
+ # Time vs potential is concatenated across files (continuous time axis)
266
+ ```
267
+
268
+ ### Standard XY files
269
+
252
270
  ```bash
253
271
  # Contour from folder of .xy/.xye/.qye/.dat
254
- batplot --operando --interactive
272
+ batplot --operando --wl 1.54 --i
255
273
 
256
274
  # With folder path
257
- batplot /path/to/data --operando --interactive
275
+ batplot /path/to/data --operando --xaxis 2theta --i
258
276
 
259
277
  # Q conversion from 2θ
260
- batplot --operando --wl 0.25995 --interactive
278
+ batplot --operando --wl 0.25995 --i
279
+
280
+ # Column selection: --readcolc for contour, --readcols for side panel (.mpt)
281
+ batplot --operando --readcolc 2 3 --readcols 1 2 --i
261
282
 
262
283
  # Derivative contour
263
- batplot --operando --1d --interactive
284
+ batplot --operando --1d --i
264
285
 
265
286
  # With CIF tick labels
266
- batplot folder phase.cif:1.54 --operando --interactive
287
+ batplot folder phase.cif:1.54 --operando --i
267
288
  ```
268
289
 
290
+ Operando column selection:
291
+ - `--readcolc <x> <y>`: columns for the contour plot (from .xy/.xye/.qye/.dat files)
292
+ - `--readcols <x> <y>`: columns for the side panel (from .mpt file)
293
+
269
294
  ---
270
295
 
271
296
  ## Plotting multiple files
@@ -273,14 +298,14 @@ batplot folder phase.cif:1.54 --operando --interactive
273
298
  ```bash
274
299
  # All XY files in current directory on same figure
275
300
  batplot allfiles
276
- batplot allfiles --stack --interactive
301
+ batplot allfiles --stack --i
277
302
 
278
303
  # Only specific extension (natural-sorted)
279
304
  batplot allxyfiles
280
- batplot "/path/to/data" allnorfiles --interactive
305
+ batplot "/path/to/data" allnorfiles --i
281
306
 
282
307
  # Explicit file list
283
- batplot file1.xye file2.qye structure.cif:1.54 --stack --interactive
308
+ batplot file1.xye file2.qye structure.cif:1.54 --stack --i
284
309
  ```
285
310
 
286
311
  ---
@@ -306,8 +331,9 @@ batplot --all --readcol 2 3 style.bps --xaxis 2theta
306
331
 
307
332
  | Type | Formats |
308
333
  |------|---------|
309
- | **Electrochemistry** | `.csv` (Neware), `.mpt` (Biologic), `.xlsx` (Landt/Lanhe CPC) |
334
+ | **Electrochemistry** | `.csv` (Neware, Biologic DataLogger), `.mpt` (Biologic), `.xlsx` (Landt/Lanhe CPC) |
310
335
  | **XRD / PDF** | `.xye`, `.xy`, `.qye`, `.dat`, `.csv`, `.txt`; Bruker `.brml`, `.raw` |
336
+ | **Operando** | `.xy`, `.xye`, `.qye`, `.dat`; Bruker `.brml` (cyc1/cyc2/cyc3); EC: `.mpt` or DataLogger `.csv` |
311
337
  | **XAS** | `.nor`, `.chik`, `.chir` |
312
338
  | **Generic** | Use `--readcol` and `--xaxis` for custom formats |
313
339
 
@@ -317,9 +343,11 @@ batplot --all --readcol 2 3 style.bps --xaxis 2theta
317
343
 
318
344
  With `--interactive`:
319
345
  - **Cycle/Scan Control**: Toggle visibility, change colors
346
+ - **Multi-file palette (EC/CV/dQdV)**: Press `c`, then type `fall viridis` (all files), `f1-5 viridis` (files 1–5), or `f1 f3 f5 4` (each file gets one color)
347
+ - **CPC file palette**: In `ly`/`ry` color submenu, apply palette to file range: `1-5 viridis`, `1 3 5 4`
320
348
  - **Styling**: Line widths, markers, fonts
321
349
  - **Axes**: Labels, limits, ticks, spine styles
322
- - **Export**: Sessions (`.pkl`), styles (`.bps`/`.bpsg`), high-res images
350
+ - **Export**: Sessions (`.pkl`), styles (`.bps`/`.bpsg`), high-res images. Colors persist via `p` (print style), `i` (import), `s` (save session), `b` (undo)
323
351
  - **Live Preview**: All changes update in real-time
324
352
 
325
353
  ---
@@ -6,9 +6,10 @@
6
6
 
7
7
  ## Features
8
8
 
9
- - **Electrochemistry Modes**: Galvanostatic cycling (GC), cyclic voltammetry (CV), differential capacity (dQdV), capacity per cycle (CPC) with multi-file support
10
- - **Normal xy plot**: Designed for XRD, PDF, XAS (XANES/EXAFS) but also support other types
11
- - **Operando Analysis**: Correlate in-situ characterizations (XRD/PDF/XAS) with electrochemical data
9
+ With a single line of command to easily plot publication-ready plots with customized, intuitive interactive editing features such as:
10
+ - **Electrochemistry Plot**: Galvanostatic cycling (GC), cyclic voltammetry (CV), differential capacity (dQdV), capacity per cycle (CPC) with multi-file support
11
+ - **1D XY plot**: Designed for XRD, PDF, XAS (XANES/EXAFS) but also support other types
12
+ - **Operando Contour plot**: Correlate in-situ characterizations (XRD/PDF/XAS) with electrochemical data
12
13
  - **Interactive plotting**: Real-time editing customized for each type of plottings
13
14
  - **Session Persistence**: Save and reload complete plot states with `.pkl` files
14
15
  - **Style Management**: Import/export plot styles as `.bps`/`.bpsg` files
@@ -18,11 +19,14 @@
18
19
 
19
20
  ```bash
20
21
  pip install batplot
22
+ # It is recommended to use separate environment for batplot to aviod compatability issues with dependencies.
21
23
  ```
22
24
 
23
25
  ## Quick Start
24
26
 
25
- Tutorial: https://drive.google.com/file/d/1NTFJWNBbWW4mgz0H5ZelGjuOBWxoFgkr/view
27
+ - Tutorial: https://drive.google.com/file/d/1NTFJWNBbWW4mgz0H5ZelGjuOBWxoFgkr/view
28
+ - Tutorial files: https://github.com/chem-plot/batplot/blob/main/batplot_tutorial.zip
29
+ - Manual: https://github.com/chem-plot/batplot/blob/main/batplot_user_manual.pdf
26
30
 
27
31
  ---
28
32
 
@@ -37,12 +41,12 @@ In batplot, --xaxis is frequently used to indicate the data type.
37
41
  # Specify X-axis type (Q, 2theta, r, k, energy, time or any user defined names)
38
42
  # By defauly, batplot will skip the header lines, plot the first and second columns as x and y
39
43
  # Q and q are equivalent (case-insensitive)
40
- batplot pattern.xye --xaxis 2theta
41
- batplot data.qye --xaxis q
42
- batplot data.txt --xaxis whatever
44
+ batplot pattern.xye --xaxis 2theta --i
45
+ batplot data.qye --xaxis q --i
46
+ batplot data.txt --xaxis whatever --i
43
47
 
44
48
  # Set X-axis range
45
- batplot pattern.xye --xaxis 2theta --xrange 10 80
49
+ batplot pattern.xye --xaxis 2theta --xrange 10 80 --i
46
50
 
47
51
  # Save to file (default .svg if no extension)
48
52
  batplot pattern.xye --xaxis 2theta --out figure
@@ -53,10 +57,10 @@ batplot pattern.txt --xaxis Energy --out figure.png
53
57
 
54
58
  ```bash
55
59
  # Convert 2θ to Q using wavelength (Å), --xaxis is no longer needed as providing wavelength is implying that user wants to convert and plot the data in Q space
56
- batplot data.raw --wl 1.5406
60
+ batplot data.raw --wl 1.5406 --i
57
61
 
58
62
  # Per-file wavelength: file.xye:1.54, in this case --xaxis is also not needed and files will be plotted in Q space
59
- batplot scan1.brml:1.5406 scan2.xye:0.7093
63
+ batplot scan1.brml:1.5406 scan2.xye:0.7093 --i
60
64
 
61
65
  # Convert and export to converted/ subfolder (q and Q equivalent)
62
66
  batplot data.xye --convert 1.54 q
@@ -71,40 +75,40 @@ batplot f1.txt --readcol 2 3 f2.txt --readcol 5 6 --convert 1.54 q
71
75
 
72
76
  ```bash
73
77
  # Stack curves vertically (auto-normalizes)
74
- batplot file1.xy file2.xy --stack
78
+ batplot file1.xy file2.xy --stack --i
75
79
 
76
80
  # Control spacing between stacked curves
77
81
  batplot file1.xy file2.xy --stack --delta 0.15
78
82
 
79
83
  # Normalize intensity to 0–1 (without stacking)
80
- batplot file.xy --norm
84
+ batplot file.xy --norm --i
81
85
  ```
82
86
 
83
87
  ### Dual y-axis (right y-axis)
84
88
 
85
89
  ```bash
86
90
  # Plot selected files on the right y-axis (--ry disables --stack)
87
- batplot file1.xy --ry file2.xy --ry file3.xy file4.xy --ry --interactive
91
+ batplot file1.xy --ry file2.xy --ry file3.xy file4.xy --ry --i
88
92
  # Files 1, 2, 4 use right y-axis; file 3 uses left y-axis
89
93
 
90
94
  # With --txaxis: right y-axis curves use the top x-axis (default: shared bottom x)
91
- batplot file1.xy --ry file2.xy --txaxis --interactive
95
+ batplot file1.xy --ry file2.xy --txaxis --i
92
96
  ```
93
97
 
94
98
  ### Column selection and multi-curve
95
99
 
96
100
  ```bash
97
101
  # Read columns 2 and 3 as X, Y (1-indexed)
98
- batplot data.xy --readcol 2 3
102
+ batplot data.xy --readcol 2 3 --wl 1.54 --i
99
103
 
100
104
  # Per-file columns
101
- batplot file1.xy --readcol 2 3 file2.xy --readcol 4 5
105
+ batplot file1.xy --readcol 2 3 file2.xy --readcol 4 5 --xaxis r --i
102
106
 
103
107
  # Multiple curves from same file (cols 1,2 and 1,3)
104
- batplot data.xy --readcol 1 2 1 3
108
+ batplot data.xy --readcol 1 2 1 3 --xaxis 2theta --i
105
109
 
106
110
  # Range: col 1 as x, cols 2–20 as 19 y-curves
107
- batplot file.txt --readcol 1 2-20
111
+ batplot file.txt --readcol 1 2-20 --xaxis Energy --i
108
112
 
109
113
  # With --convert: use custom columns when converting XRD data
110
114
  batplot data.csv --readcol 3 4 --convert 1.54 q
@@ -114,10 +118,10 @@ batplot data.csv --readcol 3 4 --convert 1.54 q
114
118
 
115
119
  ```bash
116
120
  # Plot first derivative (dy/dx)
117
- batplot file.xy --1d --stack
121
+ batplot file.xy --1d --stack --i
118
122
 
119
123
  # EXAFS k-weighting
120
- batplot data.chik --chik # χ(k)
124
+ batplot data.chik --chik --i # χ(k)
121
125
  batplot data.chik --k2chik # k²χ(k), most common
122
126
  batplot data.chik --k3chik --xrange 2 12
123
127
  ```
@@ -126,9 +130,9 @@ batplot data.chik --k3chik --xrange 2 12
126
130
 
127
131
  ```bash
128
132
  # Open interactive menu for styling, ranges, export, session save
129
- batplot pattern.xye --interactive
130
- batplot file1.xy file2.xy --stack --interactive
131
- batplot allfiles --xaxis 2theta --xrange 15 75 --interactive
133
+ batplot pattern.xye --i
134
+ batplot file1.xy file2.xy --stack --i
135
+ batplot allfiles --xaxis 2theta --xrange 15 75 --i
132
136
  ```
133
137
 
134
138
  ---
@@ -146,75 +150,96 @@ GC mode plots potential vs. capacity for each charge/discharge cycle—the prima
146
150
 
147
151
  ```bash
148
152
  # From .csv (capacity in file)
149
- batplot battery.csv --gc
153
+ batplot battery.csv --gc --i
150
154
 
151
155
  # From .mpt (requires --mass in mg)
152
- batplot battery.mpt --gc --mass 7.0
156
+ batplot battery.mpt --gc --mass 7.0 --i
153
157
 
154
- # With interactive menu
155
- batplot battery.csv --gc --interactive
156
158
  ```
157
159
 
158
160
  ### Cyclic voltammetry (CV)
159
161
 
160
162
  ```bash
161
- batplot cyclic.mpt --cv
162
- batplot cyclic.mpt --cv --interactive
163
+ batplot cyclic.mpt --cv --i
164
+ batplot cyclic.mpt --cv --i
163
165
  ```
164
166
 
165
167
  ### Differential capacity (dQ/dV)
166
168
 
167
169
  ```bash
168
- batplot battery.csv --dqdv
169
- batplot battery.csv --dqdv --interactive
170
+ batplot battery.csv --dqdv --i
170
171
  ```
171
172
 
172
173
  ### Capacity per cycle (CPC)
173
174
 
174
175
  ```bash
175
176
  # Single file
176
- batplot stability.csv --cpc
177
- batplot stability.mpt --cpc --mass 5.4
177
+ batplot stability.csv --cpc --i
178
+ batplot stability.mpt --cpc --mass 5.4 --i
178
179
 
179
180
  # Multiple files with individual colors
180
- batplot file1.csv file2.mpt --cpc --mass 6.0 --interactive
181
+ batplot file1.csv file2.mpt --cpc --mass 6.0 --i
181
182
  ```
182
183
 
183
184
  ### Time vs potential
184
185
 
185
186
  ```bash
186
187
  # Plot time (h) vs potential from CSV/MPT
187
- batplot battery.csv --xaxis time --interactive
188
+ batplot battery.csv --xaxis time --i
188
189
  ```
189
190
 
190
191
  ### Potential window (custom potential–time .mpt)
191
192
 
192
193
  ```bash
193
194
  # Two columns: potential, time. Use --pw and --cd to plot as GC
194
- batplot custom.mpt --gc --pw 0.01 3 --cd 0.2 --interactive
195
+ batplot custom.mpt --gc --pw 0.01 3 --cd 0.2 --i
195
196
  ```
196
197
 
197
198
  ---
198
199
 
199
200
  ## Operando Mode
200
201
 
202
+ Contour plots from a folder of diffraction data, optionally with an electrochemistry side panel.
203
+
204
+ ### Bruker operando (.brml)
205
+
206
+ For Bruker operando XRD (multi-scan .brml files named cyc1, cyc2, cyc3, etc.):
207
+
208
+ ```bash
209
+ # Place .brml files (e.g. RA_O5_cyc1.brml, RA_O5_cyc2.brml) in the folder
210
+ # Use --wl for Q conversion (e.g. synchrotron λ=0.709 Å)
211
+ batplot RA_O5 --operando --wl 0.709 --i
212
+
213
+ # EC side panel: .mpt or Biologic DataLogger CSV (*--DataLogger.csv), sorted by cyc
214
+ # Time vs potential is concatenated across files (continuous time axis)
215
+ ```
216
+
217
+ ### Standard XY files
218
+
201
219
  ```bash
202
220
  # Contour from folder of .xy/.xye/.qye/.dat
203
- batplot --operando --interactive
221
+ batplot --operando --wl 1.54 --i
204
222
 
205
223
  # With folder path
206
- batplot /path/to/data --operando --interactive
224
+ batplot /path/to/data --operando --xaxis 2theta --i
207
225
 
208
226
  # Q conversion from 2θ
209
- batplot --operando --wl 0.25995 --interactive
227
+ batplot --operando --wl 0.25995 --i
228
+
229
+ # Column selection: --readcolc for contour, --readcols for side panel (.mpt)
230
+ batplot --operando --readcolc 2 3 --readcols 1 2 --i
210
231
 
211
232
  # Derivative contour
212
- batplot --operando --1d --interactive
233
+ batplot --operando --1d --i
213
234
 
214
235
  # With CIF tick labels
215
- batplot folder phase.cif:1.54 --operando --interactive
236
+ batplot folder phase.cif:1.54 --operando --i
216
237
  ```
217
238
 
239
+ Operando column selection:
240
+ - `--readcolc <x> <y>`: columns for the contour plot (from .xy/.xye/.qye/.dat files)
241
+ - `--readcols <x> <y>`: columns for the side panel (from .mpt file)
242
+
218
243
  ---
219
244
 
220
245
  ## Plotting multiple files
@@ -222,14 +247,14 @@ batplot folder phase.cif:1.54 --operando --interactive
222
247
  ```bash
223
248
  # All XY files in current directory on same figure
224
249
  batplot allfiles
225
- batplot allfiles --stack --interactive
250
+ batplot allfiles --stack --i
226
251
 
227
252
  # Only specific extension (natural-sorted)
228
253
  batplot allxyfiles
229
- batplot "/path/to/data" allnorfiles --interactive
254
+ batplot "/path/to/data" allnorfiles --i
230
255
 
231
256
  # Explicit file list
232
- batplot file1.xye file2.qye structure.cif:1.54 --stack --interactive
257
+ batplot file1.xye file2.qye structure.cif:1.54 --stack --i
233
258
  ```
234
259
 
235
260
  ---
@@ -255,8 +280,9 @@ batplot --all --readcol 2 3 style.bps --xaxis 2theta
255
280
 
256
281
  | Type | Formats |
257
282
  |------|---------|
258
- | **Electrochemistry** | `.csv` (Neware), `.mpt` (Biologic), `.xlsx` (Landt/Lanhe CPC) |
283
+ | **Electrochemistry** | `.csv` (Neware, Biologic DataLogger), `.mpt` (Biologic), `.xlsx` (Landt/Lanhe CPC) |
259
284
  | **XRD / PDF** | `.xye`, `.xy`, `.qye`, `.dat`, `.csv`, `.txt`; Bruker `.brml`, `.raw` |
285
+ | **Operando** | `.xy`, `.xye`, `.qye`, `.dat`; Bruker `.brml` (cyc1/cyc2/cyc3); EC: `.mpt` or DataLogger `.csv` |
260
286
  | **XAS** | `.nor`, `.chik`, `.chir` |
261
287
  | **Generic** | Use `--readcol` and `--xaxis` for custom formats |
262
288
 
@@ -266,9 +292,11 @@ batplot --all --readcol 2 3 style.bps --xaxis 2theta
266
292
 
267
293
  With `--interactive`:
268
294
  - **Cycle/Scan Control**: Toggle visibility, change colors
295
+ - **Multi-file palette (EC/CV/dQdV)**: Press `c`, then type `fall viridis` (all files), `f1-5 viridis` (files 1–5), or `f1 f3 f5 4` (each file gets one color)
296
+ - **CPC file palette**: In `ly`/`ry` color submenu, apply palette to file range: `1-5 viridis`, `1 3 5 4`
269
297
  - **Styling**: Line widths, markers, fonts
270
298
  - **Axes**: Labels, limits, ticks, spine styles
271
- - **Export**: Sessions (`.pkl`), styles (`.bps`/`.bpsg`), high-res images
299
+ - **Export**: Sessions (`.pkl`), styles (`.bps`/`.bpsg`), high-res images. Colors persist via `p` (print style), `i` (import), `s` (save session), `b` (undo)
272
300
  - **Live Preview**: All changes update in real-time
273
301
 
274
302
  ---
@@ -1,5 +1,5 @@
1
1
  """batplot: Interactive plotting for battery data visualization."""
2
2
 
3
- __version__ = "1.8.29"
3
+ __version__ = "1.8.31"
4
4
 
5
5
  __all__ = ["__version__"]