Merge pull request 'Fix bug where a new colorbar figure would appear on each valid scan' (#5) from fix_colorbar into main

Reviewed-on: http://git.dou.bet/iamdoubz/pyfi-hmg/pulls/5
This commit was merged in pull request #5.
This commit is contained in:
iamdoubz committed 2026-05-01 00:13:05 -05:00
commit d8b3dd8632
1 file changed
+4
+4
View File
@@ -62,6 +62,10 @@ def render_heatmap(
if fig is None or ax is None: if fig is None or ax is None:
fig, ax = plt.subplots(figsize=(10, 7)) fig, ax = plt.subplots(figsize=(10, 7))
# Remove any colorbars left over from previous renders.
# Colorbars attach to the figure, not the axes, so ax.clear() doesn't touch them.
for ax_obj in fig.axes[1:]: # axes[0] is the main plot; everything else is a colorbar
ax_obj.remove()
ax.clear() ax.clear()
points, values = session.get_points_and_values_multi(bssids) points, values = session.get_points_and_values_multi(bssids)