|
@@ -1,12 +1,31 @@
|
|
|
import matplotlib.pyplot as plt
|
|
|
import numpy as np
|
|
|
# from scripts.spatial_network.perlin_map.paper_figures_spatial_head_direction_network_perlin_map import FIGURE_SAVE_PATH
|
|
|
-FIGURE_SAVE_PATH = '../../../figures/figure_4_paper_perlin/'
|
|
|
+FIGURE_SAVE_PATH = '../../../figures/supplement_max_entropy/'
|
|
|
|
|
|
from scripts.spatial_network.perlin_map.run_simulation_perlin_map import get_perlin_map
|
|
|
from scripts.spatial_maps.supplement_max_entropy_rule.spatial_layout import SpatialLayout
|
|
|
-from scripts.spatial_maps.spatial_network_layout import Interneuron, get_excitatory_phases_in_inhibitory_axon, get_position_mesh, plot_neural_sheet
|
|
|
+from scripts.spatial_maps.spatial_network_layout import Interneuron, get_excitatory_phases_in_inhibitory_axon, get_position_mesh
|
|
|
from scripts.spatial_maps.supplement_max_entropy_rule.spatial_layout import get_entropy
|
|
|
+
|
|
|
+def plot_neural_sheet(ex_positions, ex_tunings, axonal_clouds=None):
|
|
|
+ X, Y = get_position_mesh(ex_positions)
|
|
|
+
|
|
|
+ n_ex = int(np.sqrt(len(ex_positions)))
|
|
|
+ head_dir_preference = np.array(ex_tunings).reshape((n_ex, n_ex))
|
|
|
+
|
|
|
+ fig = plt.figure(figsize=(4, 4))
|
|
|
+ ax = fig.add_subplot(111)
|
|
|
+
|
|
|
+ c = ax.pcolor(X, Y, head_dir_preference, vmin=-np.pi, vmax=np.pi, cmap="twilight")
|
|
|
+ fig.colorbar(c, ax=ax, label="Orientation")
|
|
|
+ if axonal_clouds is not None:
|
|
|
+ for i, p in enumerate(axonal_clouds):
|
|
|
+ ell = p.get_ellipse()
|
|
|
+ # print(ell)
|
|
|
+ ax.add_artist(ell)
|
|
|
+
|
|
|
+
|
|
|
# Get input map
|
|
|
|
|
|
seed = 1
|
|
@@ -70,7 +89,7 @@ import matplotlib
|
|
|
# In[20]:
|
|
|
|
|
|
|
|
|
-plt.style.use('../../spatial_network/perlin_map/figures.mplstyle')
|
|
|
+plt.style.use('../../model_figure/figures.mplstyle')
|
|
|
|
|
|
# In[21]:
|
|
|
|