batplot 1.7.28__py3-none-any.whl → 1.8.1__py3-none-any.whl

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.

Potentially problematic release.


This version of batplot might be problematic. Click here for more details.

batplot/modes.py CHANGED
@@ -280,8 +280,8 @@ def handle_cv_mode(args) -> int:
280
280
  ax.set_xlabel('Current (mA)', labelpad=8.0)
281
281
  ax.set_ylabel('Voltage (V)', labelpad=8.0)
282
282
  else:
283
- ax.set_xlabel('Voltage (V)', labelpad=8.0)
284
- ax.set_ylabel('Current (mA)', labelpad=8.0)
283
+ ax.set_xlabel('Voltage (V)', labelpad=8.0)
284
+ ax.set_ylabel('Current (mA)', labelpad=8.0)
285
285
  legend = ax.legend(title='Cycle')
286
286
  legend.get_title().set_fontsize('medium')
287
287
  # Adjust margins to prevent label clipping
@@ -642,8 +642,8 @@ def handle_gc_mode(args) -> int:
642
642
  ln_c, = ax.plot(y_b, x_b, '-', color=base_colors[(cyc-1) % len(base_colors)],
643
643
  linewidth=2.0, label=str(cyc), alpha=0.8)
644
644
  else:
645
- ln_c, = ax.plot(x_b, y_b, '-', color=base_colors[(cyc-1) % len(base_colors)],
646
- linewidth=2.0, label=str(cyc), alpha=0.8)
645
+ ln_c, = ax.plot(x_b, y_b, '-', color=base_colors[(cyc-1) % len(base_colors)],
646
+ linewidth=2.0, label=str(cyc), alpha=0.8)
647
647
  else:
648
648
  ln_c = None
649
649
  mask_d = (cyc_int == cyc) & discharge_mask
@@ -656,8 +656,8 @@ def handle_gc_mode(args) -> int:
656
656
  ln_d, = ax.plot(yd_b, xd_b, '-', color=base_colors[(cyc-1) % len(base_colors)],
657
657
  linewidth=2.0, label=lbl, alpha=0.8)
658
658
  else:
659
- ln_d, = ax.plot(xd_b, yd_b, '-', color=base_colors[(cyc-1) % len(base_colors)],
660
- linewidth=2.0, label=lbl, alpha=0.8)
659
+ ln_d, = ax.plot(xd_b, yd_b, '-', color=base_colors[(cyc-1) % len(base_colors)],
660
+ linewidth=2.0, label=lbl, alpha=0.8)
661
661
  else:
662
662
  ln_d = None
663
663
  cycle_lines[cyc] = {"charge": ln_c, "discharge": ln_d}
@@ -677,8 +677,8 @@ def handle_gc_mode(args) -> int:
677
677
  ln_c, = ax.plot(y_b, x_b, '-', color=base_colors[(cyc-1) % len(base_colors)],
678
678
  linewidth=2.0, label=str(cyc), alpha=0.8)
679
679
  else:
680
- ln_c, = ax.plot(x_b, y_b, '-', color=base_colors[(cyc-1) % len(base_colors)],
681
- linewidth=2.0, label=str(cyc), alpha=0.8)
680
+ ln_c, = ax.plot(x_b, y_b, '-', color=base_colors[(cyc-1) % len(base_colors)],
681
+ linewidth=2.0, label=str(cyc), alpha=0.8)
682
682
  ln_d = None
683
683
  if i < len(dch_blocks):
684
684
  a, b = dch_blocks[i]
@@ -690,8 +690,8 @@ def handle_gc_mode(args) -> int:
690
690
  ln_d, = ax.plot(yd_b, xd_b, '-', color=base_colors[(cyc-1) % len(base_colors)],
691
691
  linewidth=2.0, label=lbl, alpha=0.8)
692
692
  else:
693
- ln_d, = ax.plot(xd_b, yd_b, '-', color=base_colors[(cyc-1) % len(base_colors)],
694
- linewidth=2.0, label=lbl, alpha=0.8)
693
+ ln_d, = ax.plot(xd_b, yd_b, '-', color=base_colors[(cyc-1) % len(base_colors)],
694
+ linewidth=2.0, label=lbl, alpha=0.8)
695
695
  cycle_lines[cyc] = {"charge": ln_c, "discharge": ln_d}
696
696
 
697
697
  # Swap x and y if --ro flag is set
@@ -699,8 +699,8 @@ def handle_gc_mode(args) -> int:
699
699
  ax.set_xlabel('Voltage (V)', labelpad=8.0)
700
700
  ax.set_ylabel(x_label_gc, labelpad=8.0)
701
701
  else:
702
- ax.set_xlabel(x_label_gc, labelpad=8.0)
703
- ax.set_ylabel('Voltage (V)', labelpad=8.0)
702
+ ax.set_xlabel(x_label_gc, labelpad=8.0)
703
+ ax.set_ylabel('Voltage (V)', labelpad=8.0)
704
704
  legend = ax.legend(title='Cycle')
705
705
  legend.get_title().set_fontsize('medium')
706
706
  fig.subplots_adjust(left=0.12, right=0.95, top=0.88, bottom=0.15)
batplot/operando.py CHANGED
@@ -315,6 +315,8 @@ def plot_operando_folder(folder: str, args) -> Tuple[plt.Figure, plt.Axes, Dict[
315
315
  extent = (grid_x.min(), grid_x.max(), 0, Zm.shape[0]-1)
316
316
  # Bottom-to-top visual order (scan 0 at bottom) to match EC time progression -> origin='lower'
317
317
  im = ax.imshow(Zm, aspect='auto', origin='lower', extent=extent, cmap='viridis', interpolation='nearest')
318
+ # Store the colormap name explicitly so it can be retrieved reliably when saving
319
+ setattr(im, '_operando_cmap_name', 'viridis')
318
320
  # Create custom colorbar axes on the left (will be positioned by layout function)
319
321
  # Create a dummy axes that will be replaced by the custom colorbar in interactive menu
320
322
  cbar_ax = fig.add_axes([0.0, 0.0, 0.01, 0.01]) # Temporary position, will be repositioned