Skip to content

Commit

Permalink
fix: corrected figure indexing
Browse files Browse the repository at this point in the history
The self.figs attribute is a dictionary with int keys. We obtain the latest figure by using the stored figure index from the data attribute.
  • Loading branch information
gtdang committed Sep 19, 2024
1 parent 749a2b5 commit e7d03f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hnn_core/gui/_viz_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -981,9 +981,10 @@ def add_figure(self, b=None):
self._simulate_edit_figure(fig_name, ax_name, sim_name,
plot_type, {}, "plot")
# template post-processing
fig_key = self.data['fig_idx']['idx'] - 1
_postprocess_template(template_name,
fig=self.figs[len(self.figs)],
idx=self.data['fig_idx']['idx'] - 1,
fig=self.figs[fig_key],
idx=fig_key,
use_ipympl=self.use_ipympl,
widgets=self.widgets,
)
Expand Down

0 comments on commit e7d03f0

Please sign in to comment.