|
@@ -1067,7 +1067,6 @@ def plot_exc_and_inh_hdi_over_corr_len(traj, plot_run_names):
|
|
|
label_expl = [traj.derived_parameters.runs[run_name].morphology.morph_label for run_name in traj.f_get_run_names()]
|
|
|
label_range = set(label_expl)
|
|
|
|
|
|
- print(corr_len_expl)
|
|
|
|
|
|
exc_hdi_frame = pd.Series(index=[corr_len_expl, seed_expl, label_expl])
|
|
|
exc_hdi_frame.index.names = ["corr_len", "seed", "label"]
|
|
@@ -1091,27 +1090,36 @@ def plot_exc_and_inh_hdi_over_corr_len(traj, plot_run_names):
|
|
|
inh_hdi_n_and_seed_mean = inh_hdi_frame.groupby(level=[0, 2]).mean()
|
|
|
inh_hdi_n_and_seed_std_dev = inh_hdi_frame.groupby(level=[0, 2]).std()
|
|
|
|
|
|
+ markersize = 4.
|
|
|
exc_style_dict = {
|
|
|
- 'no conn': ['grey', 'dashed', '', 0],
|
|
|
- 'ellipsoid': ['red', 'solid', '^', 8.],
|
|
|
- 'circular': ['lightsalmon', 'solid', '^', 8.]
|
|
|
+ 'no conn': ['dimgrey', 'dashed', '', 0],
|
|
|
+ 'ellipsoid': ['red', 'solid', '^', markersize],
|
|
|
+ 'circular': ['lightsalmon', 'solid', '^', markersize]
|
|
|
}
|
|
|
inh_style_dict = {
|
|
|
- 'no conn': ['grey', 'dashed', '', 0],
|
|
|
- 'ellipsoid': ['blue', 'solid', 'o', 8.],
|
|
|
- 'circular': ['lightblue', 'solid', 'o', 8.]
|
|
|
+ 'no conn': ['dimgrey', 'dashed', '', 0],
|
|
|
+ 'ellipsoid': ['blue', 'solid', 'o', markersize],
|
|
|
+ 'circular': ['lightblue', 'solid', 'o', markersize]
|
|
|
|
|
|
}
|
|
|
# colors = ['blue', 'grey', 'lightblue']
|
|
|
# linestyles = ['solid', 'dashed', 'solid']
|
|
|
# markers = [verts, '', 'o']
|
|
|
|
|
|
- fig, ax = plt.subplots(1, 1, figsize=(6.5, 5.5))
|
|
|
+ width = 2*panel_size
|
|
|
+ height = 1.5*panel_size
|
|
|
+ fig, ax = plt.subplots(1, 1, figsize=(width, height))
|
|
|
|
|
|
- for label in label_range:
|
|
|
+ for label in sorted(label_range, reverse=True):
|
|
|
if label == 'no conn':
|
|
|
- ax.axhline(exc_hdi_n_and_seed_mean[1, label], color='grey', linestyle='--')
|
|
|
- ax.annotate('input', xy=(1.01, 0.44), xycoords='axes fraction')
|
|
|
+ no_conn_hdi = exc_hdi_n_and_seed_mean[1, label]
|
|
|
+ ax.axhline(no_conn_hdi, color='grey', linestyle='--')
|
|
|
+
|
|
|
+ ax.annotate(short_labels(label), xy=(1.0, no_conn_hdi ), xytext=(0,-2), xycoords='axes fraction',
|
|
|
+ textcoords="offset points",
|
|
|
+ va="top", \
|
|
|
+ ha="right",
|
|
|
+ color="dimgrey")
|
|
|
|
|
|
continue
|
|
|
exc_hdi_mean = exc_hdi_n_and_seed_mean[:, label]
|
|
@@ -1134,19 +1142,22 @@ def plot_exc_and_inh_hdi_over_corr_len(traj, plot_run_names):
|
|
|
plt.fill_between(corr_len_range, inh_hdi_mean - inh_hdi_std,
|
|
|
inh_hdi_mean + inh_hdi_std, alpha=0.3, color=inh_col)
|
|
|
|
|
|
- ax.set_xlabel('Correlation length')
|
|
|
- ax.set_ylabel('Head Direction Index')
|
|
|
- ax.axvline(get_closest_correlation_length(traj, 200.0), color='k', linewidth=0.5)
|
|
|
+ ax.set_xlabel('correlation length')
|
|
|
+ ax.set_ylabel('head direction index')
|
|
|
+ ax.axvline(get_closest_correlation_length(traj, 200.0), color='k', linewidth=0.5, zorder=0)
|
|
|
ax.set_ylim(0.0, 1.0)
|
|
|
- ax.set_xlim(0.0, np.max(corr_len_range))
|
|
|
- tablelegend(ax, ncol=2, bbox_to_anchor=(0.5, 1),
|
|
|
- row_labels=['exc.', 'inh.'],
|
|
|
- col_labels=['polar', 'circular'],
|
|
|
- title_label='')
|
|
|
+ #ax.set_xlim(0.0, np.max(corr_len_range))
|
|
|
+ remove_frame(ax, ["right", "top"])
|
|
|
+
|
|
|
+ tablelegend(ax, ncol=2, bbox_to_anchor=(1.1, 1.1), loc="upper right",
|
|
|
+ row_labels=None,
|
|
|
+ col_labels=[short_labels(label) for label in sorted(label_range-{"no conn"}, reverse=True)],
|
|
|
+ title_label='', borderaxespad=0, handlelength=2, edgecolor='white')
|
|
|
+ fig.subplots_adjust(bottom=0.2, left=0.2)
|
|
|
# plt.legend()
|
|
|
|
|
|
if save_figs:
|
|
|
- plt.savefig(FIGURE_SAVE_PATH + 'exc_and_inh_hdi_over_corr_len_scaled.png', dpi=200)
|
|
|
+ plt.savefig(FIGURE_SAVE_PATH + 'F_hdi_over_corr_len_scaled.png')
|
|
|
|
|
|
|
|
|
def plot_in_degree_map(traj, plot_run_names):
|