Minor figure updates 02.03.2022
This commit is contained in:
parent
81599f7748
commit
c8df08c34d
@ -4,20 +4,15 @@ Created on Sat Jul 3 19:52:04 2021
|
|||||||
|
|
||||||
@author: nils
|
@author: nils
|
||||||
"""
|
"""
|
||||||
import seaborn as sns
|
|
||||||
import matplotlib.pyplot as plt
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import string
|
import string
|
||||||
import textwrap
|
import textwrap
|
||||||
import json
|
import json
|
||||||
import matplotlib
|
import matplotlib
|
||||||
import matplotlib.cm as cm
|
|
||||||
import matplotlib.lines as mlines
|
import matplotlib.lines as mlines
|
||||||
from matplotlib import ticker
|
from matplotlib import ticker
|
||||||
from matplotlib.collections import LineCollection
|
from matplotlib.ticker import NullFormatter
|
||||||
from matplotlib.ticker import StrMethodFormatter, NullFormatter
|
|
||||||
from plotstyle import boxplot_style
|
|
||||||
|
|
||||||
#%% ##################### From https://stackoverflow.com/questions/52878845/swarmplot-with-hue-affecting-marker-beyond-color ##
|
#%% ##################### From https://stackoverflow.com/questions/52878845/swarmplot-with-hue-affecting-marker-beyond-color ##
|
||||||
# to change marker types in seaborn swarmplot
|
# to change marker types in seaborn swarmplot
|
||||||
@ -28,7 +23,6 @@ import matplotlib.pyplot as plt
|
|||||||
############## Begin hack ##############
|
############## Begin hack ##############
|
||||||
from matplotlib.axes._axes import Axes
|
from matplotlib.axes._axes import Axes
|
||||||
from matplotlib.markers import MarkerStyle
|
from matplotlib.markers import MarkerStyle
|
||||||
from seaborn import color_palette
|
|
||||||
from numpy import ndarray
|
from numpy import ndarray
|
||||||
|
|
||||||
def GetColor2Marker(markers):
|
def GetColor2Marker(markers):
|
||||||
@ -444,7 +438,7 @@ plot_AUC_alt(ax1_ex,model='FS +$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$', color1='l
|
|||||||
plot_AUC_alt(ax2_ex, model='STN +$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$', color1='lightgrey', color2='k', alteration='g')
|
plot_AUC_alt(ax2_ex, model='STN +$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$', color1='lightgrey', color2='k', alteration='g')
|
||||||
|
|
||||||
#save
|
#save
|
||||||
fig.savefig('AUC_correlation.pdf', bbox_inches='tight', dpi=fig.dpi)
|
fig.savefig('./Figures/AUC_correlation.pdf', bbox_inches='tight', dpi=fig.dpi)
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
# #%% alternative layout
|
# #%% alternative layout
|
||||||
|
@ -178,7 +178,7 @@ for i in range(0,len(models)):
|
|||||||
spike_axs[i].text(-0.18, 1.08, string.ascii_uppercase[i], transform=spike_axs[i].transAxes, size=16, weight='bold')
|
spike_axs[i].text(-0.18, 1.08, string.ascii_uppercase[i], transform=spike_axs[i].transAxes, size=16, weight='bold')
|
||||||
|
|
||||||
# save
|
# save
|
||||||
fig.savefig('diversity_in_firing.pdf', bbox_inches='tight')
|
fig.savefig('./Figures/diversity_in_firing.pdf', bbox_inches='tight')
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ $\uparrow$ rheobase''')
|
|||||||
ax3_BR = ax3.inset_axes([0.7, 0, 0.3, 0.2])
|
ax3_BR = ax3.inset_axes([0.7, 0, 0.3, 0.2])
|
||||||
plot_diff_sqrt(ax3_BR, b2=0.4, c2=75)
|
plot_diff_sqrt(ax3_BR, b2=0.4, c2=75)
|
||||||
ax3_BR.set_ylim(inset_ylim)
|
ax3_BR.set_ylim(inset_ylim)
|
||||||
fig.savefig('firing_characterization.pdf', bbox_inches='tight')
|
fig.savefig('./Figures/firing_characterization.pdf', bbox_inches='tight')
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
@ -131,5 +131,5 @@ add_scalebar(ax11_ramp, matchx=False, matchy=False, hidex=True, hidey=True, size
|
|||||||
for i in range(0,len(models)):
|
for i in range(0,len(models)):
|
||||||
ramp_axs[i].text(-0.05, 1.08, string.ascii_uppercase[i], transform=ramp_axs[i].transAxes, size=16, weight='bold')
|
ramp_axs[i].text(-0.05, 1.08, string.ascii_uppercase[i], transform=ramp_axs[i].transAxes, size=16, weight='bold')
|
||||||
|
|
||||||
fig.savefig('ramp_firing.pdf')
|
fig.savefig('./Figures/ramp_firing.pdf')
|
||||||
plt.show()
|
plt.show()
|
@ -4,20 +4,15 @@ Created on Sat Jul 3 19:52:04 2021
|
|||||||
|
|
||||||
@author: nils
|
@author: nils
|
||||||
"""
|
"""
|
||||||
import seaborn as sns
|
|
||||||
import matplotlib.pyplot as plt
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import string
|
import string
|
||||||
import textwrap
|
import textwrap
|
||||||
import json
|
import json
|
||||||
import matplotlib
|
import matplotlib
|
||||||
import matplotlib.cm as cm
|
|
||||||
import matplotlib.lines as mlines
|
import matplotlib.lines as mlines
|
||||||
from matplotlib import ticker
|
from matplotlib import ticker
|
||||||
from matplotlib.collections import LineCollection
|
from matplotlib.ticker import NullFormatter
|
||||||
from matplotlib.ticker import StrMethodFormatter, NullFormatter
|
|
||||||
from plotstyle import boxplot_style
|
|
||||||
|
|
||||||
#%% ##################### From https://stackoverflow.com/questions/52878845/swarmplot-with-hue-affecting-marker-beyond-color ##
|
#%% ##################### From https://stackoverflow.com/questions/52878845/swarmplot-with-hue-affecting-marker-beyond-color ##
|
||||||
# to change marker types in seaborn swarmplot
|
# to change marker types in seaborn swarmplot
|
||||||
@ -28,7 +23,6 @@ import matplotlib.pyplot as plt
|
|||||||
############## Begin hack ##############
|
############## Begin hack ##############
|
||||||
from matplotlib.axes._axes import Axes
|
from matplotlib.axes._axes import Axes
|
||||||
from matplotlib.markers import MarkerStyle
|
from matplotlib.markers import MarkerStyle
|
||||||
from seaborn import color_palette
|
|
||||||
from numpy import ndarray
|
from numpy import ndarray
|
||||||
|
|
||||||
def GetColor2Marker(markers):
|
def GetColor2Marker(markers):
|
||||||
@ -413,7 +407,7 @@ plot_rheo_alt(ax1_ex,model='Cb stellate +$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$',
|
|||||||
plot_rheo_alt(ax2_ex, model='Cb stellate', color1='lightgrey', color2='k', alteration='g')
|
plot_rheo_alt(ax2_ex, model='Cb stellate', color1='lightgrey', color2='k', alteration='g')
|
||||||
|
|
||||||
# save
|
# save
|
||||||
fig.savefig('rheobase_correlation.pdf', bbox_inches='tight')
|
fig.savefig('./Figures/rheobase_correlation.pdf', bbox_inches='tight')
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
# #%% alternative layout
|
# #%% alternative layout
|
||||||
|
Binary file not shown.
@ -1,14 +1,9 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
from matplotlib.collections import LineCollection
|
|
||||||
import os
|
|
||||||
import json
|
|
||||||
import matplotlib.cm as cm
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import os
|
import os
|
||||||
import string
|
import string
|
||||||
from plotstyle import plot_style
|
from plotstyle import plot_style
|
||||||
from adjustText import adjust_text
|
|
||||||
import seaborn as sns
|
import seaborn as sns
|
||||||
import scipy.stats as stats
|
import scipy.stats as stats
|
||||||
import matplotlib.lines as mlines
|
import matplotlib.lines as mlines
|
||||||
@ -27,7 +22,13 @@ def Kendall_tau(df):
|
|||||||
|
|
||||||
def correlation_plot(ax, df='AUC', title='', cbar=False):
|
def correlation_plot(ax, df='AUC', title='', cbar=False):
|
||||||
cbar_ax = fig.add_axes([0.94, .25, .03, .4])
|
cbar_ax = fig.add_axes([0.94, .25, .03, .4])
|
||||||
|
cbar_ax.spines['left'].set_visible(False)
|
||||||
|
cbar_ax.spines['bottom'].set_visible(False)
|
||||||
|
cbar_ax.spines['right'].set_visible(False)
|
||||||
|
cbar_ax.spines['top'].set_visible(False)
|
||||||
|
# cbar_ax.axis('off')
|
||||||
|
cbar_ax.set_xticks([])
|
||||||
|
cbar_ax.set_yticks([])
|
||||||
if df == 'AUC':
|
if df == 'AUC':
|
||||||
df = pd.read_csv(os.path.join('./Figures/Data/sim_mut_AUC.csv'), index_col='Unnamed: 0')
|
df = pd.read_csv(os.path.join('./Figures/Data/sim_mut_AUC.csv'), index_col='Unnamed: 0')
|
||||||
elif df == 'rheo':
|
elif df == 'rheo':
|
||||||
@ -168,8 +169,9 @@ def mutation_legend(ax, marker_s_leg, pos, ncol):
|
|||||||
E283K = mlines.Line2D([], [], color=colors[2], marker=Markers[2], markersize=marker_s_leg, linestyle='None', label='E283K')
|
E283K = mlines.Line2D([], [], color=colors[2], marker=Markers[2], markersize=marker_s_leg, linestyle='None', label='E283K')
|
||||||
V404I = mlines.Line2D([], [], color=colors[5], marker=Markers[3], markersize=marker_s_leg, linestyle='None',
|
V404I = mlines.Line2D([], [], color=colors[5], marker=Markers[3], markersize=marker_s_leg, linestyle='None',
|
||||||
label='V404I')
|
label='V404I')
|
||||||
|
WT = mlines.Line2D([], [], color='k', marker='s', markersize=marker_s_leg+5, linestyle='None', label='Wild type')
|
||||||
|
|
||||||
ax.legend(handles=[V174F, F414C, E283K, V404I], loc='center', bbox_to_anchor=pos, ncol=ncol, frameon=False)
|
ax.legend(handles=[WT, V174F, F414C, E283K, V404I], loc='center', bbox_to_anchor=pos, ncol=ncol, frameon=False)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -207,7 +209,7 @@ ax22 = mutation_plot2(ax22, model='STN_Kv_only')
|
|||||||
|
|
||||||
marker_s_leg = 4
|
marker_s_leg = 4
|
||||||
pos = (0.25, -0.45)
|
pos = (0.25, -0.45)
|
||||||
ncol = 4
|
ncol = 5
|
||||||
mutation_legend(ax21, marker_s_leg, pos, ncol)
|
mutation_legend(ax21, marker_s_leg, pos, ncol)
|
||||||
|
|
||||||
# plot correlation matrices
|
# plot correlation matrices
|
||||||
@ -224,5 +226,5 @@ axr0.text(-0.38, 1.2, string.ascii_uppercase[j], transform=axr0.transAxes, size=
|
|||||||
axr1.text(-0.38, 1.2, string.ascii_uppercase[j+1], transform=axr1.transAxes, size=16, weight='bold')
|
axr1.text(-0.38, 1.2, string.ascii_uppercase[j+1], transform=axr1.transAxes, size=16, weight='bold')
|
||||||
|
|
||||||
# save
|
# save
|
||||||
fig.savefig('simulation_model_comparison.pdf', bbox_inches='tight')
|
fig.savefig('./Figures/simulation_model_comparison.pdf', bbox_inches='tight')
|
||||||
plt.show()
|
plt.show()
|
||||||
|
Loading…
Reference in New Issue
Block a user