Finished fig_auditory_pathway.svg, pending feedback (all colors are temporary until color code is finalized).

This commit is contained in:
j-hartling
2025-12-04 12:09:19 +01:00
parent a5292c3d37
commit a0d9e73e08
31 changed files with 5907 additions and 2319 deletions

View File

@@ -9,22 +9,20 @@ plt.rc('text.latex', preamble=r'\usepackage{amsmath}')
# Settings:
fs_chart = 70
fs_lines = 75
fs_legend = 40
show_figs = True
grid_props = dict(left=0, right=1, top=1, bottom=0)
fig_props = {
'figsize': (3, 3),
'facecolor': 'none',
'edgecolor': 'none',
'frameon': False,
# 'rasterized': True,
}
ax_props = {
'facecolor': 'none',
'frame_on': False,
# 'rasterized': True,
}
text_props = {
@@ -33,40 +31,60 @@ text_props = {
'y': 0.5,
'ha': 'center',
'va': 'center',
# 'rasterized': True,
}
# Targets:
texts = {
'filt': (r'$x_{\text{filt}}$', fs_chart),
'env': (r'$x_{\text{env}}$', fs_chart),
'db': (r'$x_{\text{dB}}$', fs_chart),
'envdb': (r'$\begin{array}{c}x_{\text{env}}\\x_{\text{dB}}\end{array}$', fs_chart),
'adapt': (r'$x_{\text{adapt}}$', fs_chart),
'conv1': (r'$c_1$', fs_chart),
'conv2': (r'$c_2$', fs_chart),
'conv3': (r'$c_3$', fs_chart),
'bi1': (r'$b_{1, \Theta}$', fs_chart),
'bi2': (r'$b_{2, \Theta}$', fs_chart),
'bi3': (r'$b_{3, \Theta}$', fs_chart),
'feat1': (r'$f_{1, \Theta}$', fs_chart),
'feat2': (r'$f_{2, \Theta}$', fs_chart),
'feat3': (r'$f_{3, \Theta}$', fs_chart),
'BP': ('BP', fs_chart),
'LP': ('LP', fs_chart),
'HP': ('HP', fs_chart),
'tympanum': ('Tympanal\nMembrane', fs_legend),
'receptors': ('Receptor\nNeurons', fs_legend),
'interneurons': ('Local\nInterneurons', fs_legend),
'ascending': ('Ascending\nNeurons', fs_legend),
'threshold': ('Threshold\nNonlinearity', fs_legend),
'integration': ('Temporal\nAveraging', fs_legend),
'brain': ('Central\nBrain', fs_legend),
# CIRCUIT ELEMENTS:
# 'filt': (r'$x_{\text{filt}}$', fs_chart, (3, 3)),
# 'env': (r'$x_{\text{env}}$', fs_chart, (3, 3)),
# 'db': (r'$x_{\text{dB}}$', fs_chart, (3, 3)),
# 'envdb': (r'$\begin{array}{c}x_{\text{env}}\\x_{\text{dB}}\end{array}$', fs_chart, (3, 3)),
# 'adapt': (r'$x_{\text{adapt}}$', fs_chart, (3, 3)),
# 'conv1': (r'$c_1$', fs_chart, (3, 3)),
# 'conv2': (r'$c_2$', fs_chart, (3, 3)),
# 'conv3': (r'$c_3$', fs_chart, (3, 3)),
# 'bi1': (r'$b_{1, \Theta}$', fs_chart, (3, 3)),
# 'bi2': (r'$b_{2, \Theta}$', fs_chart, (3, 3)),
# 'bi3': (r'$b_{3, \Theta}$', fs_chart, (3, 3)),
# 'feat1': (r'$f_{1, \Theta}$', fs_chart, (3, 3)),
# 'feat2': (r'$f_{2, \Theta}$', fs_chart, (3, 3)),
# 'feat3': (r'$f_{3, \Theta}$', fs_chart, (3, 3)),
# 'out': (r'$\hat{y}$', fs_chart, (3, 3)),
# CIRCUIT OPERATIONS:
'rectlp': (r'$\lvert\cdot\lvert,h_{\text{LP}}$', fs_lines, (3, 3)),
'log': (r'$\text{log}$', fs_lines, (3, 3)),
'rectlplog': (r'$\begin{array}{c}||,h_{\text{LP}}\\\text{log}\end{array}$', fs_lines, (3, 3)),
'k1': (r'$k_1$', fs_lines, (3, 3)),
'k2': (r'$k_2$', fs_lines, (3, 3)),
'k3': (r'$k_3$', fs_lines, (3, 3)),
'bp': (r'$h_{\text{BP}}$', fs_lines, (3, 3)),
'lp': (r'$h_{\text{LP}}$', fs_lines, (3, 3)),
'hp': (r'$h_{\text{HP}}$', fs_lines, (3, 3)),
'theta1': (r'$\Theta_1$', fs_lines, (3, 3)),
'theta2': (r'$\Theta_2$', fs_lines, (3, 3)),
'theta3': (r'$\Theta_3$', fs_lines, (3, 3)),
'w1': (r'$\omega_1$', fs_lines, (3, 3)),
'w2': (r'$\omega_2$', fs_lines, (3, 3)),
'w3': (r'$\omega_3$', fs_lines, (3, 3)),
'thresh1': (r'$H(c_1-\Theta_1)$', fs_lines, (3, 3)),
'thresh2': (r'$H(c_2-\Theta_2)$', fs_lines, (3, 3)),
'thresh3': (r'$H(c_3-\Theta_3)$', fs_lines, (3, 3)),
# LEGEND ELEMENTS:
# 'tympanum': ('Tympanal\nMembrane', fs_legend, (3, 3)),
# 'receptors': ('Receptor\nNeuron\nPopulation', fs_legend, (3, 3)),
# 'interneurons': ('Local\nInterneuron\nPopulation', fs_legend, (3, 3)),
# 'ascending': ('Individual\nAscending\nNeurons', fs_legend, (3, 3)),
# 'threshold': ('Threshold\nNonlinearity', fs_legend, (3, 3)),
# 'integration': ('Temporal\nAveraging', fs_legend, (3, 3)),
# 'brain': ('Weighting\nand\nReadout', fs_legend, (3, 3)),
}
# Save each target string:
for name, (text, fs) in texts.items():
fig, ax = plt.subplots(1, 1, gridspec_kw=grid_props, **fig_props)
for name, (text, fs, size) in texts.items():
fig, ax = plt.subplots(figsize=size, gridspec_kw=grid_props, **fig_props)
ax.set(**ax_props)
ax.axis('off')
ax.text(s=text, fontsize=fs, **text_props)