Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] GUI fix minor glitches #899

Merged
merged 3 commits into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions hnn_core/gui/_viz_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,12 @@ def _static_rerender(widgets, fig, fig_idx):
fig_output = widgets['figs_tabs'].children[fig_tab_idx]
fig_output.clear_output()
with fig_output:
fig.tight_layout()
display(fig)


def _dynamic_rerender(fig):
fig.canvas.draw()
fig.canvas.flush_events()
fig.tight_layout()


def _avg_dipole_check(dpls):
Expand Down Expand Up @@ -762,15 +760,11 @@ def _add_figure(b, widgets, data, template_type, scale=0.95, dpi=96):
scale * ((int(viz_output_layout.height[:-2]) - 10) / dpi))
mosaic = template_type['mosaic']
kwargs = template_type['kwargs']
plt.ioff()
fig, axd = plt.subplot_mosaic(mosaic,
figsize=figsize,
dpi=dpi,
**kwargs)
plt.ion()
fig.tight_layout()
fig.canvas.header_visible = False
fig.canvas.footer_visible = False
with plt.ioff():
ntolley marked this conversation as resolved.
Show resolved Hide resolved
fig = plt.figure(figsize=figsize, dpi=dpi, layout='constrained')
axd = fig.subplot_mosaic(mosaic, **kwargs)
fig.canvas.header_visible = False
fig.canvas.footer_visible = False

if data['use_ipympl'] is False:
plt.show()
Expand All @@ -781,6 +775,7 @@ def _add_figure(b, widgets, data, template_type, scale=0.95, dpi=96):

data['figs'][fig_idx] = fig
widgets['figs_tabs'].selected_index = n_tabs
widgets['axes_config_tabs'].selected_index = n_tabs
data['fig_idx']['idx'] += 1


Expand Down
Loading