batplot 1.3.7__tar.gz → 1.3.8__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.
- {batplot-1.3.7 → batplot-1.3.8}/PKG-INFO +1 -1
- {batplot-1.3.7 → batplot-1.3.8}/batplot/__init__.py +1 -1
- {batplot-1.3.7 → batplot-1.3.8}/batplot/operando.py +2 -2
- {batplot-1.3.7 → batplot-1.3.8}/batplot/session.py +40 -2
- {batplot-1.3.7 → batplot-1.3.8}/batplot.egg-info/PKG-INFO +1 -1
- {batplot-1.3.7 → batplot-1.3.8}/pyproject.toml +1 -1
- {batplot-1.3.7 → batplot-1.3.8}/LICENSE +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/README.md +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot/args.py +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot/batch.py +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot/batplot.py +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot/batplot_new.py +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot/cif.py +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot/cli.py +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot/converters.py +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot/cpc_interactive.py +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot/electrochem_interactive.py +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot/interactive.py +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot/modes.py +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot/operando_ec_interactive.py +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot/plotting.py +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot/readers.py +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot/style.py +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot/ui.py +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot/utils.py +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot.egg-info/SOURCES.txt +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot.egg-info/dependency_links.txt +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot.egg-info/entry_points.txt +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot.egg-info/requires.txt +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/batplot.egg-info/top_level.txt +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/setup.cfg +0 -0
- {batplot-1.3.7 → batplot-1.3.8}/setup.py +0 -0
|
@@ -167,8 +167,8 @@ def plot_operando_folder(folder: str, args) -> Tuple[plt.Figure, plt.Axes, Dict[
|
|
|
167
167
|
# Use imshow for speed; mask nans
|
|
168
168
|
Zm = np.ma.masked_invalid(Z)
|
|
169
169
|
extent = (grid_x.min(), grid_x.max(), 0, Zm.shape[0]-1)
|
|
170
|
-
#
|
|
171
|
-
im = ax.imshow(Zm, aspect='auto', origin='
|
|
170
|
+
# Bottom-to-top visual order (scan 0 at bottom) to match EC time progression -> origin='lower'
|
|
171
|
+
im = ax.imshow(Zm, aspect='auto', origin='lower', extent=extent, cmap='viridis', interpolation='nearest')
|
|
172
172
|
# Place colorbar on the left
|
|
173
173
|
cbar = fig.colorbar(im, ax=ax, location='left', pad=0.15)
|
|
174
174
|
cbar.ax.yaxis.set_ticks_position('left')
|
|
@@ -135,12 +135,24 @@ def dump_session(
|
|
|
135
135
|
for side in ('top', 'bottom', 'left', 'right'):
|
|
136
136
|
sp_obj = axis.spines.get(side)
|
|
137
137
|
prefix = {'top': 't', 'bottom': 'b', 'left': 'l', 'right': 'r'}[side]
|
|
138
|
+
# Consistent tick/title state logic for all sides
|
|
139
|
+
if side == 'left':
|
|
140
|
+
ylabel_text = axis.get_ylabel()
|
|
141
|
+
title_state = bool(ylabel_text)
|
|
142
|
+
elif side == 'bottom':
|
|
143
|
+
title_state = bool(axis.get_xlabel())
|
|
144
|
+
elif side == 'top':
|
|
145
|
+
title_state = bool(getattr(axis, '_top_xlabel_on', False))
|
|
146
|
+
elif side == 'right':
|
|
147
|
+
title_state = bool(getattr(axis, '_right_ylabel_on', False))
|
|
148
|
+
else:
|
|
149
|
+
title_state = False
|
|
138
150
|
wasd[side] = {
|
|
139
151
|
'spine': bool(sp_obj.get_visible() if sp_obj else False),
|
|
140
152
|
'ticks': bool(ts.get(f'{prefix}_ticks', ts.get({'top':'tx','bottom':'bx','left':'ly','right':'ry'}[side], side=='bottom' or side=='left'))),
|
|
141
153
|
'minor': bool(ts.get(f'm{prefix}x' if side in ('top','bottom') else f'm{prefix}y', False)),
|
|
142
154
|
'labels': bool(ts.get(f'{prefix}_labels', ts.get({'top':'tx','bottom':'bx','left':'ly','right':'ry'}[side], side=='bottom' or side=='left'))),
|
|
143
|
-
'title':
|
|
155
|
+
'title': title_state,
|
|
144
156
|
}
|
|
145
157
|
return wasd
|
|
146
158
|
|
|
@@ -321,12 +333,26 @@ def dump_operando_session(
|
|
|
321
333
|
for side in ('top', 'bottom', 'left', 'right'):
|
|
322
334
|
sp = axis.spines.get(side)
|
|
323
335
|
prefix = {'top': 't', 'bottom': 'b', 'left': 'l', 'right': 'r'}[side]
|
|
336
|
+
# For 'left' side ylabel: check if it's currently visible (has text)
|
|
337
|
+
# If hidden but has stored text, the title state should be False (hidden)
|
|
338
|
+
if side == 'left':
|
|
339
|
+
ylabel_text = axis.get_ylabel()
|
|
340
|
+
title_state = bool(ylabel_text) # True only if currently visible with text
|
|
341
|
+
elif side == 'bottom':
|
|
342
|
+
title_state = bool(axis.get_xlabel())
|
|
343
|
+
elif side == 'top':
|
|
344
|
+
title_state = bool(getattr(axis, '_top_xlabel_on', False))
|
|
345
|
+
elif side == 'right':
|
|
346
|
+
title_state = bool(getattr(axis, '_right_ylabel_on', False))
|
|
347
|
+
else:
|
|
348
|
+
title_state = False
|
|
349
|
+
|
|
324
350
|
wasd[side] = {
|
|
325
351
|
'spine': bool(sp.get_visible() if sp else False),
|
|
326
352
|
'ticks': bool(ts.get(f'{prefix}_ticks', ts.get({'top':'tx','bottom':'bx','left':'ly','right':'ry'}[side], side=='bottom' or side=='left'))),
|
|
327
353
|
'minor': bool(ts.get(f'm{prefix}x' if side in ('top','bottom') else f'm{prefix}y', False)),
|
|
328
354
|
'labels': bool(ts.get(f'{prefix}_labels', ts.get({'top':'tx','bottom':'bx','left':'ly','right':'ry'}[side], side=='bottom' or side=='left'))),
|
|
329
|
-
'title':
|
|
355
|
+
'title': title_state,
|
|
330
356
|
}
|
|
331
357
|
return wasd
|
|
332
358
|
|
|
@@ -414,6 +440,7 @@ def dump_operando_session(
|
|
|
414
440
|
'wasd_state': ec_wasd_state,
|
|
415
441
|
'spines': ec_spines,
|
|
416
442
|
'ticks': {'widths': ec_ticks},
|
|
443
|
+
'stored_ylabel': getattr(ec_ax, '_stored_ylabel', None), # Save hidden ylabel text
|
|
417
444
|
}
|
|
418
445
|
|
|
419
446
|
sess = {
|
|
@@ -440,6 +467,7 @@ def dump_operando_session(
|
|
|
440
467
|
'wasd_state': op_wasd_state,
|
|
441
468
|
'spines': op_spines,
|
|
442
469
|
'ticks': {'widths': op_ticks},
|
|
470
|
+
'stored_ylabel': getattr(ax, '_stored_ylabel', None), # Save hidden ylabel text
|
|
443
471
|
},
|
|
444
472
|
'colorbar': {
|
|
445
473
|
'label': cb_label,
|
|
@@ -549,6 +577,11 @@ def load_operando_session(filename: str):
|
|
|
549
577
|
# Persist custom labels
|
|
550
578
|
setattr(ax, '_custom_labels', dict(op.get('custom_labels', {'x': None, 'y': None})))
|
|
551
579
|
|
|
580
|
+
# Restore stored ylabel if present (for cases where ylabel was hidden with a5)
|
|
581
|
+
stored_ylabel = op.get('stored_ylabel')
|
|
582
|
+
if stored_ylabel is not None:
|
|
583
|
+
setattr(ax, '_stored_ylabel', stored_ylabel)
|
|
584
|
+
|
|
552
585
|
# Apply operando WASD state if version 2+
|
|
553
586
|
version = sess.get('version', 1)
|
|
554
587
|
if version >= 2:
|
|
@@ -750,6 +783,11 @@ def load_operando_session(filename: str):
|
|
|
750
783
|
except Exception:
|
|
751
784
|
pass
|
|
752
785
|
|
|
786
|
+
# Restore stored ylabel if present (for cases where ylabel was hidden)
|
|
787
|
+
stored_ylabel = ec.get('stored_ylabel')
|
|
788
|
+
if stored_ylabel is not None:
|
|
789
|
+
setattr(ec_ax, '_stored_ylabel', stored_ylabel)
|
|
790
|
+
|
|
753
791
|
# Apply EC WASD state if version 2+
|
|
754
792
|
if version >= 2:
|
|
755
793
|
ec_wasd = ec.get('wasd_state')
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "batplot"
|
|
7
|
-
version = "1.3.
|
|
7
|
+
version = "1.3.8"
|
|
8
8
|
description = "Interactive plotting for XRD, PDF, and XAS data (.xye, .xy, .qye, .dat, .csv, .gr, .nor, .chik, .chir)"
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "Tian Dai", email = "tianda@uio.no" }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|