Skip to content

Commit

Permalink
add layer to legend
Browse files Browse the repository at this point in the history
  • Loading branch information
dylansdaniels committed Nov 26, 2024
1 parent 8a5b450 commit cd0d727
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions hnn_core/gui/_viz_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,20 +298,28 @@ def _update_ax(fig, ax, single_simulation, sim_name, plot_type, plot_config):
min_f = plot_config['min_spectral_frequency']
max_f = plot_config['max_spectral_frequency']
color = ax._get_lines.get_next_color()
dpls_copied[0].plot_psd(fmin=min_f, fmax=max_f, ax=ax, color=color,
label=sim_name, show=False)
label = sim_name + " (Aggregate)"
dpls_copied[0].plot_psd(
fmin=min_f,
fmax=max_f,
color=color,
label=label,
ax=ax,
show=False
)

elif plot_type == 'layer 2 PSD':
if len(dpls_copied) > 0:
min_f = plot_config['min_spectral_frequency']
max_f = plot_config['max_spectral_frequency']
color = ax._get_lines.get_next_color()
label = sim_name + " (Layer 2/3)"
dpls_copied[0].plot_psd(
fmin=min_f,
fmax=max_f,
layer='L2',
color=color,
label=sim_name,
label=label,
ax=ax,
show=False
)
Expand All @@ -321,12 +329,13 @@ def _update_ax(fig, ax, single_simulation, sim_name, plot_type, plot_config):
min_f = plot_config['min_spectral_frequency']
max_f = plot_config['max_spectral_frequency']
color = ax._get_lines.get_next_color()
label = sim_name + " (Layer 5)"
dpls_copied[0].plot_psd(
fmin=min_f,
fmax=max_f,
layer='L5',
color=color,
label=sim_name,
label=label,
ax=ax,
show=False
)
Expand Down

0 comments on commit cd0d727

Please sign in to comment.