batplot 1.8.26__tar.gz → 1.8.28__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 (44) hide show
  1. batplot-1.8.28/PKG-INFO +348 -0
  2. batplot-1.8.28/README.md +297 -0
  3. {batplot-1.8.26 → batplot-1.8.28}/USER_MANUAL.md +184 -29
  4. {batplot-1.8.26 → batplot-1.8.28}/batplot/__init__.py +1 -1
  5. {batplot-1.8.26 → batplot-1.8.28}/batplot/args.py +204 -161
  6. {batplot-1.8.26 → batplot-1.8.28}/batplot/batch.py +132 -38
  7. {batplot-1.8.26 → batplot-1.8.28}/batplot/batplot.py +451 -104
  8. {batplot-1.8.26 → batplot-1.8.28}/batplot/cli.py +0 -14
  9. {batplot-1.8.26 → batplot-1.8.28}/batplot/cpc_interactive.py +893 -328
  10. {batplot-1.8.26 → batplot-1.8.28}/batplot/data/CHANGELOG.md +37 -37
  11. {batplot-1.8.26 → batplot-1.8.28}/batplot/data/USER_MANUAL.md +50 -19
  12. {batplot-1.8.26 → batplot-1.8.28}/batplot/electrochem_interactive.py +707 -417
  13. {batplot-1.8.26 → batplot-1.8.28}/batplot/interactive.py +215 -167
  14. {batplot-1.8.26 → batplot-1.8.28}/batplot/manual.py +1 -1
  15. {batplot-1.8.26 → batplot-1.8.28}/batplot/modes.py +22 -7
  16. {batplot-1.8.26 → batplot-1.8.28}/batplot/operando.py +9 -9
  17. {batplot-1.8.26 → batplot-1.8.28}/batplot/operando_ec_interactive.py +328 -267
  18. {batplot-1.8.26 → batplot-1.8.28}/batplot/readers.py +132 -30
  19. {batplot-1.8.26 → batplot-1.8.28}/batplot/session.py +161 -94
  20. {batplot-1.8.26 → batplot-1.8.28}/batplot/style.py +52 -18
  21. {batplot-1.8.26 → batplot-1.8.28}/batplot/utils.py +39 -12
  22. {batplot-1.8.26 → batplot-1.8.28}/batplot/version_check.py +3 -4
  23. batplot-1.8.28/batplot.egg-info/PKG-INFO +348 -0
  24. {batplot-1.8.26 → batplot-1.8.28}/pyproject.toml +1 -1
  25. batplot-1.8.26/PKG-INFO +0 -204
  26. batplot-1.8.26/README.md +0 -153
  27. batplot-1.8.26/batplot.egg-info/PKG-INFO +0 -204
  28. {batplot-1.8.26 → batplot-1.8.28}/LICENSE +0 -0
  29. {batplot-1.8.26 → batplot-1.8.28}/MANIFEST.in +0 -0
  30. {batplot-1.8.26 → batplot-1.8.28}/NOTICE +0 -0
  31. {batplot-1.8.26 → batplot-1.8.28}/batplot/cif.py +0 -0
  32. {batplot-1.8.26 → batplot-1.8.28}/batplot/color_utils.py +0 -0
  33. {batplot-1.8.26 → batplot-1.8.28}/batplot/config.py +0 -0
  34. {batplot-1.8.26 → batplot-1.8.28}/batplot/converters.py +0 -0
  35. {batplot-1.8.26 → batplot-1.8.28}/batplot/dev_upgrade.py +0 -0
  36. {batplot-1.8.26 → batplot-1.8.28}/batplot/plotting.py +0 -0
  37. {batplot-1.8.26 → batplot-1.8.28}/batplot/ui.py +0 -0
  38. {batplot-1.8.26 → batplot-1.8.28}/batplot.egg-info/SOURCES.txt +0 -0
  39. {batplot-1.8.26 → batplot-1.8.28}/batplot.egg-info/dependency_links.txt +0 -0
  40. {batplot-1.8.26 → batplot-1.8.28}/batplot.egg-info/entry_points.txt +0 -0
  41. {batplot-1.8.26 → batplot-1.8.28}/batplot.egg-info/requires.txt +0 -0
  42. {batplot-1.8.26 → batplot-1.8.28}/batplot.egg-info/top_level.txt +0 -0
  43. {batplot-1.8.26 → batplot-1.8.28}/setup.cfg +0 -0
  44. {batplot-1.8.26 → batplot-1.8.28}/setup.py +0 -0
@@ -0,0 +1,348 @@
1
+ Metadata-Version: 2.4
2
+ Name: batplot
3
+ Version: 1.8.28
4
+ Summary: Interactive plotting tool for material science (1D plot) and electrochemistry (GC, CV, dQ/dV, CPC, operando) with batch processing
5
+ Author-email: Tian Dai <tianda@uio.no>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 Tian Dai
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/chem-plot/batplot
29
+ Project-URL: Repository, https://github.com/chem-plot/batplot
30
+ Project-URL: Issues, https://github.com/chem-plot/batplot/issues
31
+ Classifier: Programming Language :: Python
32
+ Classifier: Programming Language :: Python :: 3
33
+ Classifier: Programming Language :: Python :: 3 :: Only
34
+ Classifier: Programming Language :: Python :: 3.9
35
+ Classifier: Programming Language :: Python :: 3.10
36
+ Classifier: Programming Language :: Python :: 3.11
37
+ Classifier: Programming Language :: Python :: 3.12
38
+ Classifier: Programming Language :: Python :: 3.13
39
+ Classifier: Operating System :: OS Independent
40
+ Classifier: Intended Audience :: Science/Research
41
+ Classifier: Topic :: Scientific/Engineering :: Visualization
42
+ Requires-Python: >=3.9
43
+ Description-Content-Type: text/markdown
44
+ License-File: LICENSE
45
+ License-File: NOTICE
46
+ Requires-Dist: numpy>=1.21.0
47
+ Requires-Dist: matplotlib>=3.5.0
48
+ Requires-Dist: rich>=10.0.0
49
+ Requires-Dist: openpyxl>=3.0.0
50
+ Dynamic: license-file
51
+
52
+ # batplot
53
+
54
+ **Interactive plotting tool for battery and materials characterization data**
55
+
56
+ `batplot` is a Python CLI tool for visualizing and analyzing electrochemical and structural characterization data with interactive styling and session management. The electrochemistry and operando plots were inspired from Amalie Skurtveit's python scripts (https://github.com/piieceofcake?tab=repositories).
57
+
58
+ ## Features
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
63
+ - **Interactive plotting**: Real-time editing customized for each type of plottings
64
+ - **Session Persistence**: Save and reload complete plot states with `.pkl` files
65
+ - **Style Management**: Import/export plot styles as `.bps`/`.bpsg` files
66
+ - **Batch Processing**: Export each file separately with `--all`
67
+
68
+ ## Installation
69
+
70
+ ```bash
71
+ pip install batplot
72
+ ```
73
+
74
+ ## Quick Start
75
+
76
+ Tutorial: https://drive.google.com/file/d/1NTFJWNBbWW4mgz0H5ZelGjuOBWxoFgkr/view
77
+
78
+ ---
79
+
80
+ ## 1D (XY) Mode — XRD, PDF, XAS and much more
81
+
82
+ In batplot, --xaxis is frequently used to indicate the data type.
83
+
84
+ ### Basic plotting
85
+
86
+ ```bash
87
+
88
+ # Specify X-axis type (Q, 2theta, r, k, energy, time or any user defined names)
89
+ # By defauly, batplot will skip the header lines, plot the first and second columns as x and y
90
+ # 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
94
+
95
+ # Set X-axis range
96
+ batplot pattern.xye --xaxis 2theta --xrange 10 80
97
+
98
+ # Save to file (default .svg if no extension)
99
+ batplot pattern.xye --xaxis 2theta --out figure
100
+ batplot pattern.txt --xaxis Energy --out figure.png
101
+ ```
102
+
103
+ ### Wavelength and Q conversion for XRD data
104
+
105
+ ```bash
106
+ # 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
108
+
109
+ # 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
111
+
112
+ # Convert and export to converted/ subfolder (q and Q equivalent)
113
+ batplot data.xye --convert 1.54 q
114
+ batplot data.qye --convert q 1.54
115
+ ```
116
+
117
+ ### Stacking and normalization
118
+
119
+ ```bash
120
+ # Stack curves vertically (auto-normalizes)
121
+ batplot file1.xy file2.xy --stack
122
+
123
+ # Control spacing between stacked curves
124
+ batplot file1.xy file2.xy --stack --delta 0.15
125
+
126
+ # Normalize intensity to 0–1 (without stacking)
127
+ batplot file.xy --norm
128
+ ```
129
+
130
+ ### Dual y-axis (right y-axis)
131
+
132
+ ```bash
133
+ # Plot selected files on the right y-axis (--ry disables --stack)
134
+ batplot file1.xy --ry file2.xy --ry file3.xy file4.xy --ry --interactive
135
+ # Files 1, 2, 4 use right y-axis; file 3 uses left y-axis
136
+
137
+ # With --txaxis: right y-axis curves use the top x-axis (default: shared bottom x)
138
+ batplot file1.xy --ry file2.xy --txaxis --interactive
139
+ ```
140
+
141
+ ### Column selection and multi-curve
142
+
143
+ ```bash
144
+ # Read columns 2 and 3 as X, Y (1-indexed)
145
+ batplot data.xy --readcol 2 3
146
+
147
+ # Per-file columns
148
+ batplot file1.xy --readcol 2 3 file2.xy --readcol 4 5
149
+
150
+ # Multiple curves from same file (cols 1,2 and 1,3)
151
+ batplot data.xy --readcol 1 2 1 3
152
+
153
+ # Range: col 1 as x, cols 2–20 as 19 y-curves
154
+ batplot file.txt --readcol 1 2-20
155
+ ```
156
+
157
+ ### Derivatives and EXAFS
158
+
159
+ ```bash
160
+ # Plot first derivative (dy/dx)
161
+ batplot file.xy --1d --stack
162
+
163
+ # EXAFS k-weighting
164
+ batplot data.chik --chik # χ(k)
165
+ batplot data.chik --k2chik # k²χ(k), most common
166
+ batplot data.chik --k3chik --xrange 2 12
167
+ ```
168
+
169
+ ### Interactive menu
170
+
171
+ ```bash
172
+ # Open interactive menu for styling, ranges, export, session save
173
+ batplot pattern.xye --interactive
174
+ batplot file1.xy file2.xy --stack --interactive
175
+ batplot allfiles --xaxis 2theta --xrange 15 75 --interactive
176
+ ```
177
+
178
+ ---
179
+
180
+ ## Electrochemistry Mode
181
+
182
+ ### Data export requirements from instruments
183
+
184
+ - **Neware**: Customized report — check all boxes
185
+ - **Biologic**: Export all info to .mpt file
186
+
187
+ ### Galvanostatic cycling (GC)
188
+
189
+ ```bash
190
+ # From .csv (capacity in file)
191
+ batplot battery.csv --gc
192
+
193
+ # From .mpt (requires --mass in mg)
194
+ batplot battery.mpt --gc --mass 7.0
195
+
196
+ # With interactive menu
197
+ batplot battery.csv --gc --interactive
198
+ ```
199
+
200
+ ### Cyclic voltammetry (CV)
201
+
202
+ ```bash
203
+ batplot cyclic.mpt --cv
204
+ batplot cyclic.mpt --cv --interactive
205
+ ```
206
+
207
+ ### Differential capacity (dQ/dV)
208
+
209
+ ```bash
210
+ batplot battery.csv --dqdv
211
+ batplot battery.csv --dqdv --interactive
212
+ ```
213
+
214
+ ### Capacity per cycle (CPC)
215
+
216
+ ```bash
217
+ # Single file
218
+ batplot stability.csv --cpc
219
+ batplot stability.mpt --cpc --mass 5.4
220
+
221
+ # Multiple files with individual colors
222
+ batplot file1.csv file2.mpt --cpc --mass 6.0 --interactive
223
+ ```
224
+
225
+ ### Time vs potential
226
+
227
+ ```bash
228
+ # Plot time (h) vs potential from CSV/MPT
229
+ batplot battery.csv --xaxis time --interactive
230
+ ```
231
+
232
+ ### Potential window (custom potential–time .mpt)
233
+
234
+ ```bash
235
+ # Two columns: potential, time. Use --pw and --cd to plot as GC
236
+ batplot custom.mpt --gc --pw 0.01 3 --cd 0.2 --interactive
237
+ ```
238
+
239
+ ---
240
+
241
+ ## Operando Mode
242
+
243
+ ```bash
244
+ # Contour from folder of .xy/.xye/.qye/.dat
245
+ batplot --operando --interactive
246
+
247
+ # With folder path
248
+ batplot /path/to/data --operando --interactive
249
+
250
+ # Q conversion from 2θ
251
+ batplot --operando --wl 0.25995 --interactive
252
+
253
+ # Derivative contour
254
+ batplot --operando --1d --interactive
255
+
256
+ # With CIF tick labels
257
+ batplot folder phase.cif:1.54 --operando --interactive
258
+ ```
259
+
260
+ ---
261
+
262
+ ## Plotting multiple files
263
+
264
+ ```bash
265
+ # All XY files in current directory on same figure
266
+ batplot allfiles
267
+ batplot allfiles --stack --interactive
268
+
269
+ # Only specific extension (natural-sorted)
270
+ batplot allxyfiles
271
+ batplot "/path/to/data" allnorfiles --interactive
272
+
273
+ # Explicit file list
274
+ batplot file1.xye file2.qye structure.cif:1.54 --stack --interactive
275
+ ```
276
+
277
+ ---
278
+
279
+ ## Batch export (--all)
280
+
281
+ Export each file as a separate figure to `batplot_svg/`:
282
+
283
+ ```bash
284
+ batplot --all
285
+ batplot --all --format png
286
+ batplot --all --xaxis 2theta --xrange 10 80
287
+ batplot --all style.bps --gc --mass 7
288
+ ```
289
+
290
+ ---
291
+
292
+ ## Supported File Formats
293
+
294
+ | Type | Formats |
295
+ |------|---------|
296
+ | **Electrochemistry** | `.csv` (Neware), `.mpt` (Biologic), `.xlsx` (Landt/Lanhe CPC) |
297
+ | **XRD / PDF** | `.xye`, `.xy`, `.qye`, `.dat`, `.csv`, `.txt`; Bruker `.brml`, `.raw` |
298
+ | **XAS** | `.nor`, `.chik`, `.chir` |
299
+ | **Generic** | Use `--readcol` and `--xaxis` for custom formats |
300
+
301
+ ---
302
+
303
+ ## Interactive Features
304
+
305
+ With `--interactive`:
306
+ - **Cycle/Scan Control**: Toggle visibility, change colors
307
+ - **Styling**: Line widths, markers, fonts
308
+ - **Axes**: Labels, limits, ticks, spine styles
309
+ - **Export**: Sessions (`.pkl`), styles (`.bps`/`.bpsg`), high-res images
310
+ - **Live Preview**: All changes update in real-time
311
+
312
+ ---
313
+
314
+ ## Help & Documentation
315
+
316
+ ```bash
317
+ batplot --help # General help
318
+ batplot --help xy # XY mode guide
319
+ batplot --help ec # Electrochemistry guide
320
+ batplot --help op # Operando guide
321
+ batplot --version # Version and release notes
322
+ batplot --manual # Open illustrated manual
323
+ ```
324
+
325
+ - [USER_MANUAL.md](USER_MANUAL.md) — Detailed usage and workflows
326
+ - [FLAGS_REFERENCE.md](FLAGS_REFERENCE.md) — Complete flag reference by mode
327
+
328
+ ---
329
+
330
+ ## Requirements
331
+
332
+ - Python ≥ 3.9
333
+ - numpy
334
+ - matplotlib
335
+
336
+ ## License
337
+
338
+ See [LICENSE](LICENSE)
339
+
340
+ ## Author & Contact
341
+
342
+ Tian Dai
343
+ tianda@uio.no
344
+ University of Oslo
345
+ https://www.mn.uio.no/kjemi/english/people/aca/tianda/
346
+ https://github.com/chem-plot/
347
+
348
+ **Subscribe for Updates**: Join batplot-lab@kjemi.uio.no for updates. If not from UiO, email sympa@kjemi.uio.no with subject: "subscribe batplot-lab@kjemi.uio.no your-name"
@@ -0,0 +1,297 @@
1
+ # batplot
2
+
3
+ **Interactive plotting tool for battery and materials characterization data**
4
+
5
+ `batplot` is a Python CLI tool for visualizing and analyzing electrochemical and structural characterization data with interactive styling and session management. The electrochemistry and operando plots were inspired from Amalie Skurtveit's python scripts (https://github.com/piieceofcake?tab=repositories).
6
+
7
+ ## Features
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
12
+ - **Interactive plotting**: Real-time editing customized for each type of plottings
13
+ - **Session Persistence**: Save and reload complete plot states with `.pkl` files
14
+ - **Style Management**: Import/export plot styles as `.bps`/`.bpsg` files
15
+ - **Batch Processing**: Export each file separately with `--all`
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ pip install batplot
21
+ ```
22
+
23
+ ## Quick Start
24
+
25
+ Tutorial: https://drive.google.com/file/d/1NTFJWNBbWW4mgz0H5ZelGjuOBWxoFgkr/view
26
+
27
+ ---
28
+
29
+ ## 1D (XY) Mode — XRD, PDF, XAS and much more
30
+
31
+ In batplot, --xaxis is frequently used to indicate the data type.
32
+
33
+ ### Basic plotting
34
+
35
+ ```bash
36
+
37
+ # Specify X-axis type (Q, 2theta, r, k, energy, time or any user defined names)
38
+ # By defauly, batplot will skip the header lines, plot the first and second columns as x and y
39
+ # 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
43
+
44
+ # Set X-axis range
45
+ batplot pattern.xye --xaxis 2theta --xrange 10 80
46
+
47
+ # Save to file (default .svg if no extension)
48
+ batplot pattern.xye --xaxis 2theta --out figure
49
+ batplot pattern.txt --xaxis Energy --out figure.png
50
+ ```
51
+
52
+ ### Wavelength and Q conversion for XRD data
53
+
54
+ ```bash
55
+ # 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
57
+
58
+ # 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
60
+
61
+ # Convert and export to converted/ subfolder (q and Q equivalent)
62
+ batplot data.xye --convert 1.54 q
63
+ batplot data.qye --convert q 1.54
64
+ ```
65
+
66
+ ### Stacking and normalization
67
+
68
+ ```bash
69
+ # Stack curves vertically (auto-normalizes)
70
+ batplot file1.xy file2.xy --stack
71
+
72
+ # Control spacing between stacked curves
73
+ batplot file1.xy file2.xy --stack --delta 0.15
74
+
75
+ # Normalize intensity to 0–1 (without stacking)
76
+ batplot file.xy --norm
77
+ ```
78
+
79
+ ### Dual y-axis (right y-axis)
80
+
81
+ ```bash
82
+ # Plot selected files on the right y-axis (--ry disables --stack)
83
+ batplot file1.xy --ry file2.xy --ry file3.xy file4.xy --ry --interactive
84
+ # Files 1, 2, 4 use right y-axis; file 3 uses left y-axis
85
+
86
+ # With --txaxis: right y-axis curves use the top x-axis (default: shared bottom x)
87
+ batplot file1.xy --ry file2.xy --txaxis --interactive
88
+ ```
89
+
90
+ ### Column selection and multi-curve
91
+
92
+ ```bash
93
+ # Read columns 2 and 3 as X, Y (1-indexed)
94
+ batplot data.xy --readcol 2 3
95
+
96
+ # Per-file columns
97
+ batplot file1.xy --readcol 2 3 file2.xy --readcol 4 5
98
+
99
+ # Multiple curves from same file (cols 1,2 and 1,3)
100
+ batplot data.xy --readcol 1 2 1 3
101
+
102
+ # Range: col 1 as x, cols 2–20 as 19 y-curves
103
+ batplot file.txt --readcol 1 2-20
104
+ ```
105
+
106
+ ### Derivatives and EXAFS
107
+
108
+ ```bash
109
+ # Plot first derivative (dy/dx)
110
+ batplot file.xy --1d --stack
111
+
112
+ # EXAFS k-weighting
113
+ batplot data.chik --chik # χ(k)
114
+ batplot data.chik --k2chik # k²χ(k), most common
115
+ batplot data.chik --k3chik --xrange 2 12
116
+ ```
117
+
118
+ ### Interactive menu
119
+
120
+ ```bash
121
+ # Open interactive menu for styling, ranges, export, session save
122
+ batplot pattern.xye --interactive
123
+ batplot file1.xy file2.xy --stack --interactive
124
+ batplot allfiles --xaxis 2theta --xrange 15 75 --interactive
125
+ ```
126
+
127
+ ---
128
+
129
+ ## Electrochemistry Mode
130
+
131
+ ### Data export requirements from instruments
132
+
133
+ - **Neware**: Customized report — check all boxes
134
+ - **Biologic**: Export all info to .mpt file
135
+
136
+ ### Galvanostatic cycling (GC)
137
+
138
+ ```bash
139
+ # From .csv (capacity in file)
140
+ batplot battery.csv --gc
141
+
142
+ # From .mpt (requires --mass in mg)
143
+ batplot battery.mpt --gc --mass 7.0
144
+
145
+ # With interactive menu
146
+ batplot battery.csv --gc --interactive
147
+ ```
148
+
149
+ ### Cyclic voltammetry (CV)
150
+
151
+ ```bash
152
+ batplot cyclic.mpt --cv
153
+ batplot cyclic.mpt --cv --interactive
154
+ ```
155
+
156
+ ### Differential capacity (dQ/dV)
157
+
158
+ ```bash
159
+ batplot battery.csv --dqdv
160
+ batplot battery.csv --dqdv --interactive
161
+ ```
162
+
163
+ ### Capacity per cycle (CPC)
164
+
165
+ ```bash
166
+ # Single file
167
+ batplot stability.csv --cpc
168
+ batplot stability.mpt --cpc --mass 5.4
169
+
170
+ # Multiple files with individual colors
171
+ batplot file1.csv file2.mpt --cpc --mass 6.0 --interactive
172
+ ```
173
+
174
+ ### Time vs potential
175
+
176
+ ```bash
177
+ # Plot time (h) vs potential from CSV/MPT
178
+ batplot battery.csv --xaxis time --interactive
179
+ ```
180
+
181
+ ### Potential window (custom potential–time .mpt)
182
+
183
+ ```bash
184
+ # Two columns: potential, time. Use --pw and --cd to plot as GC
185
+ batplot custom.mpt --gc --pw 0.01 3 --cd 0.2 --interactive
186
+ ```
187
+
188
+ ---
189
+
190
+ ## Operando Mode
191
+
192
+ ```bash
193
+ # Contour from folder of .xy/.xye/.qye/.dat
194
+ batplot --operando --interactive
195
+
196
+ # With folder path
197
+ batplot /path/to/data --operando --interactive
198
+
199
+ # Q conversion from 2θ
200
+ batplot --operando --wl 0.25995 --interactive
201
+
202
+ # Derivative contour
203
+ batplot --operando --1d --interactive
204
+
205
+ # With CIF tick labels
206
+ batplot folder phase.cif:1.54 --operando --interactive
207
+ ```
208
+
209
+ ---
210
+
211
+ ## Plotting multiple files
212
+
213
+ ```bash
214
+ # All XY files in current directory on same figure
215
+ batplot allfiles
216
+ batplot allfiles --stack --interactive
217
+
218
+ # Only specific extension (natural-sorted)
219
+ batplot allxyfiles
220
+ batplot "/path/to/data" allnorfiles --interactive
221
+
222
+ # Explicit file list
223
+ batplot file1.xye file2.qye structure.cif:1.54 --stack --interactive
224
+ ```
225
+
226
+ ---
227
+
228
+ ## Batch export (--all)
229
+
230
+ Export each file as a separate figure to `batplot_svg/`:
231
+
232
+ ```bash
233
+ batplot --all
234
+ batplot --all --format png
235
+ batplot --all --xaxis 2theta --xrange 10 80
236
+ batplot --all style.bps --gc --mass 7
237
+ ```
238
+
239
+ ---
240
+
241
+ ## Supported File Formats
242
+
243
+ | Type | Formats |
244
+ |------|---------|
245
+ | **Electrochemistry** | `.csv` (Neware), `.mpt` (Biologic), `.xlsx` (Landt/Lanhe CPC) |
246
+ | **XRD / PDF** | `.xye`, `.xy`, `.qye`, `.dat`, `.csv`, `.txt`; Bruker `.brml`, `.raw` |
247
+ | **XAS** | `.nor`, `.chik`, `.chir` |
248
+ | **Generic** | Use `--readcol` and `--xaxis` for custom formats |
249
+
250
+ ---
251
+
252
+ ## Interactive Features
253
+
254
+ With `--interactive`:
255
+ - **Cycle/Scan Control**: Toggle visibility, change colors
256
+ - **Styling**: Line widths, markers, fonts
257
+ - **Axes**: Labels, limits, ticks, spine styles
258
+ - **Export**: Sessions (`.pkl`), styles (`.bps`/`.bpsg`), high-res images
259
+ - **Live Preview**: All changes update in real-time
260
+
261
+ ---
262
+
263
+ ## Help & Documentation
264
+
265
+ ```bash
266
+ batplot --help # General help
267
+ batplot --help xy # XY mode guide
268
+ batplot --help ec # Electrochemistry guide
269
+ batplot --help op # Operando guide
270
+ batplot --version # Version and release notes
271
+ batplot --manual # Open illustrated manual
272
+ ```
273
+
274
+ - [USER_MANUAL.md](USER_MANUAL.md) — Detailed usage and workflows
275
+ - [FLAGS_REFERENCE.md](FLAGS_REFERENCE.md) — Complete flag reference by mode
276
+
277
+ ---
278
+
279
+ ## Requirements
280
+
281
+ - Python ≥ 3.9
282
+ - numpy
283
+ - matplotlib
284
+
285
+ ## License
286
+
287
+ See [LICENSE](LICENSE)
288
+
289
+ ## Author & Contact
290
+
291
+ Tian Dai
292
+ tianda@uio.no
293
+ University of Oslo
294
+ https://www.mn.uio.no/kjemi/english/people/aca/tianda/
295
+ https://github.com/chem-plot/
296
+
297
+ **Subscribe for Updates**: Join batplot-lab@kjemi.uio.no for updates. If not from UiO, email sympa@kjemi.uio.no with subject: "subscribe batplot-lab@kjemi.uio.no your-name"