update figures based on discussion with Jan and Lukas and added gmax distribution figure
10168
Figures/AUC_correlation.eps
Normal file
BIN
Figures/AUC_correlation.jpg
Normal file
|
After Width: | Height: | Size: 441 KiB |
BIN
Figures/AUC_correlation.png
Normal file
|
After Width: | Height: | Size: 273 KiB |
BIN
Figures/Untitled.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
Figures/__pycache__/plotstyle.cpython-39.pyc
Normal file
8115
Figures/diversity_in_firing.eps
Normal file
BIN
Figures/diversity_in_firing.jpg
Normal file
|
After Width: | Height: | Size: 110 KiB |
BIN
Figures/diversity_in_firing.png
Normal file
|
After Width: | Height: | Size: 91 KiB |
@@ -140,7 +140,7 @@ gs00 = gs0[:,0].subgridspec(5, 3, wspace=1.8, hspace=1.5)
|
||||
gs01 = gs0[:,1].subgridspec(5, 3, wspace=1.8, hspace=1.5)
|
||||
gs02 = gs0[:,2].subgridspec(5, 3, wspace=1.8, hspace=1.5)
|
||||
|
||||
ax_diag = fig.add_subplot(gs02[:3, :])
|
||||
ax_diag = fig.add_subplot(gs02[2:, :])
|
||||
import matplotlib.image as mpimg
|
||||
img = mpimg.imread('./Figures/model_diagram2.png')
|
||||
ax_diag.imshow(img)
|
||||
@@ -156,26 +156,26 @@ ax1_spikes = fig.add_subplot(gs00[0,0:2])
|
||||
ax1_fI = fig.add_subplot(gs00[0, 2])
|
||||
ax2_spikes = fig.add_subplot(gs01[0,0:2])
|
||||
ax2_fI = fig.add_subplot(gs01[0, 2])
|
||||
ax3_spikes = fig.add_subplot(gs00[1,0:2])
|
||||
ax3_fI = fig.add_subplot(gs00[1, 2])
|
||||
ax4_spikes = fig.add_subplot(gs01[1,0:2])
|
||||
ax4_fI = fig.add_subplot(gs01[1, 2])
|
||||
ax5_spikes = fig.add_subplot(gs00[2, 0:2])
|
||||
ax5_fI = fig.add_subplot(gs00[2, 2])
|
||||
ax6_spikes = fig.add_subplot(gs01[2, 0:2])
|
||||
ax6_fI = fig.add_subplot(gs01[2, 2])
|
||||
ax7_spikes = fig.add_subplot(gs00[3,0:2])
|
||||
ax7_fI = fig.add_subplot(gs00[3, 2])
|
||||
ax8_spikes = fig.add_subplot(gs01[3,0:2])
|
||||
ax8_fI = fig.add_subplot(gs01[3, 2])
|
||||
ax9_spikes = fig.add_subplot(gs00[4,0:2])
|
||||
ax9_fI = fig.add_subplot(gs00[4, 2])
|
||||
ax10_spikes = fig.add_subplot(gs01[4,0:2])
|
||||
ax10_fI = fig.add_subplot(gs01[4, 2])
|
||||
ax11_spikes = fig.add_subplot(gs02[3,0:2])
|
||||
ax11_fI = fig.add_subplot(gs02[3, 2])
|
||||
ax12_spikes = fig.add_subplot(gs02[4,0:2])
|
||||
ax12_fI = fig.add_subplot(gs02[4, 2])
|
||||
ax3_spikes = fig.add_subplot(gs02[0,0:2])
|
||||
ax3_fI = fig.add_subplot(gs02[0, 2])
|
||||
ax4_spikes = fig.add_subplot(gs00[1,0:2])
|
||||
ax4_fI = fig.add_subplot(gs00[1, 2])
|
||||
ax5_spikes = fig.add_subplot(gs01[1, 0:2])
|
||||
ax5_fI = fig.add_subplot(gs01[1, 2])
|
||||
ax6_spikes = fig.add_subplot(gs02[1,0:2])
|
||||
ax6_fI = fig.add_subplot(gs02[1, 2])
|
||||
ax7_spikes = fig.add_subplot(gs00[2,0:2])
|
||||
ax7_fI = fig.add_subplot(gs00[2, 2])
|
||||
ax8_spikes = fig.add_subplot(gs01[2,0:2])
|
||||
ax8_fI = fig.add_subplot(gs01[2, 2])
|
||||
ax9_spikes = fig.add_subplot(gs00[3,0:2])
|
||||
ax9_fI = fig.add_subplot(gs00[3, 2])
|
||||
ax10_spikes = fig.add_subplot(gs01[3,0:2])
|
||||
ax10_fI = fig.add_subplot(gs01[3, 2])
|
||||
ax11_spikes = fig.add_subplot(gs00[4,0:2])
|
||||
ax11_fI = fig.add_subplot(gs00[4, 2])
|
||||
ax12_spikes = fig.add_subplot(gs01[4, 0:2])
|
||||
ax12_fI = fig.add_subplot(gs01[4, 2])
|
||||
|
||||
spike_axs = [ax1_spikes, ax2_spikes, ax3_spikes, ax4_spikes, ax5_spikes,ax6_spikes, ax7_spikes, ax8_spikes,
|
||||
ax11_spikes,ax9_spikes,ax10_spikes, ax12_spikes]#, ax13_spikes, ax14_spikes]
|
||||
@@ -195,12 +195,12 @@ for i in range(len(models)):
|
||||
plot_fI(fI_axs[i], model=models[i])
|
||||
|
||||
# add scalebars
|
||||
add_scalebar(ax9_spikes, matchx=False, matchy=False, hidex=True, hidey=True, sizex=100, sizey=50, labelx='100\u2009ms',
|
||||
add_scalebar(ax6_spikes, matchx=False, matchy=False, hidex=True, hidey=True, sizex=100, sizey=50, labelx='100\u2009ms',
|
||||
labely='50\u2009mV', loc=3, pad=-0.5, borderpad=-1.0, barwidth=2, bbox_to_anchor=Bbox.from_bounds(-0.275, -0.05, 1, 1),
|
||||
bbox_transform=ax9_spikes.transAxes)
|
||||
add_scalebar(ax10_spikes, matchx=False, matchy=False, hidex=True, hidey=True, sizex=100, sizey=50, labelx='100\u2009ms',
|
||||
bbox_transform=ax6_spikes.transAxes)
|
||||
add_scalebar(ax11_spikes, matchx=False, matchy=False, hidex=True, hidey=True, sizex=100, sizey=50, labelx='100\u2009ms',
|
||||
labely='50\u2009mV', loc=3, pad=-0.5, borderpad=-1.0, barwidth=2, bbox_to_anchor=Bbox.from_bounds(-0.275, -0.05, 1, 1),
|
||||
bbox_transform=ax10_spikes.transAxes)
|
||||
bbox_transform=ax11_spikes.transAxes)
|
||||
add_scalebar(ax12_spikes, matchx=False, matchy=False, hidex=True, hidey=True, sizex=100, sizey=50, labelx='100\u2009ms',
|
||||
labely='50\u2009mV', loc=3, pad=-0.5, borderpad=-1.0, barwidth=2, bbox_to_anchor=Bbox.from_bounds(-0.275, -0.05, 1, 1),
|
||||
bbox_transform=ax12_spikes.transAxes)
|
||||
|
||||
BIN
Figures/diversity_in_firing_diagram.jpg
Normal file
|
After Width: | Height: | Size: 452 KiB |
BIN
Figures/diversity_in_firing_diagram.pdf
Normal file
2438
Figures/firing_characterization.eps
Normal file
BIN
Figures/firing_characterization.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
2480
Figures/firing_characterization_arrows.eps
Normal file
BIN
Figures/firing_characterization_arrows.jpg
Normal file
|
After Width: | Height: | Size: 150 KiB |
BIN
Figures/firing_characterization_arrows.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
Figures/model_diagram.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
Figures/model_diagram2.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
Figures/model_g.jpg
Normal file
|
After Width: | Height: | Size: 513 KiB |
177
Figures/model_g.py
Normal file
@@ -0,0 +1,177 @@
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib.ticker as ticker
|
||||
import string
|
||||
from plotstyle import scheme_style
|
||||
import pandas as pd
|
||||
from matplotlib import cm
|
||||
|
||||
def cm2inch(*tupl):
|
||||
inch = 2.54
|
||||
if isinstance(tupl[0], tuple):
|
||||
return tuple(i / inch for i in tupl[0])
|
||||
else:
|
||||
return tuple(i / inch for i in tupl)
|
||||
|
||||
|
||||
def show_spines(ax, spines='lrtb'):
|
||||
""" Show and hide spines.
|
||||
|
||||
From github.com/janscience/plottools.git spines.py
|
||||
|
||||
Parameters
|
||||
----------
|
||||
ax: matplotlib figure, matplotlib axis, or list of matplotlib axes
|
||||
Axis on which spine and ticks visibility is manipulated.
|
||||
If figure, then apply manipulations on all axes of the figure.
|
||||
If list of axes, apply manipulations on each of the given axes.
|
||||
spines: string
|
||||
Specify which spines and ticks should be shown.
|
||||
All other ones or hidden.
|
||||
'l' is the left spine, 'r' the right spine,
|
||||
't' the top one and 'b' the bottom one.
|
||||
E.g. 'lb' shows the left and bottom spine, and hides the top
|
||||
and and right spines, as well as their tick marks and labels.
|
||||
'' shows no spines at all.
|
||||
'lrtb' shows all spines and tick marks.
|
||||
|
||||
Examples
|
||||
--------
|
||||
```py
|
||||
import matplotlib.pyplot as plt
|
||||
import plottools.spines
|
||||
|
||||
fig, (ax0, ax1, ax2) = plt.subplots(1, 3)
|
||||
ax0.show_spines('lb')
|
||||
ax1.show_spines('bt')
|
||||
ax2.show_spines('tr')
|
||||
```
|
||||

|
||||
"""
|
||||
# collect spine visibility:
|
||||
xspines = []
|
||||
if 't' in spines:
|
||||
xspines.append('top')
|
||||
if 'b' in spines:
|
||||
xspines.append('bottom')
|
||||
yspines = []
|
||||
if 'l' in spines:
|
||||
yspines.append('left')
|
||||
if 'r' in spines:
|
||||
yspines.append('right')
|
||||
# collect axes:
|
||||
if isinstance(ax, (list, tuple, np.ndarray)):
|
||||
axs = ax
|
||||
elif hasattr(ax, 'get_axes'):
|
||||
# ax is figure:
|
||||
axs = ax.get_axes()
|
||||
else:
|
||||
axs = [ax]
|
||||
if not isinstance(axs, (list, tuple)):
|
||||
axs = [axs]
|
||||
for ax in axs:
|
||||
# hide spines:
|
||||
ax.spines['top'].set_visible('top' in xspines)
|
||||
ax.spines['bottom'].set_visible('bottom' in xspines)
|
||||
ax.spines['left'].set_visible('left' in yspines)
|
||||
ax.spines['right'].set_visible('right' in yspines)
|
||||
# ticks:
|
||||
if len(xspines) == 0:
|
||||
ax.xaxis.set_ticks_position('none')
|
||||
ax.xaxis.label.set_visible(False)
|
||||
ax.xaxis._orig_major_locator = ax.xaxis.get_major_locator()
|
||||
ax.xaxis.set_major_locator(ticker.NullLocator())
|
||||
else:
|
||||
if hasattr(ax.xaxis, '_orig_major_locator'):
|
||||
ax.xaxis.set_major_locator(ax.xaxis._orig_major_locator)
|
||||
delattr(ax.xaxis, '_orig_major_locator')
|
||||
elif isinstance(ax.xaxis.get_major_locator(), ticker.NullLocator):
|
||||
ax.xaxis.set_major_locator(ticker.AutoLocator())
|
||||
if len(xspines) == 1:
|
||||
ax.xaxis.set_ticks_position(xspines[0])
|
||||
ax.xaxis.set_label_position(xspines[0])
|
||||
else:
|
||||
ax.xaxis.set_ticks_position('both')
|
||||
ax.xaxis.set_label_position('bottom')
|
||||
if len(yspines) == 0:
|
||||
ax.yaxis.set_ticks_position('none')
|
||||
ax.yaxis.label.set_visible(False)
|
||||
ax.yaxis._orig_major_locator = ax.yaxis.get_major_locator()
|
||||
ax.yaxis.set_major_locator(ticker.NullLocator())
|
||||
else:
|
||||
if hasattr(ax.yaxis, '_orig_major_locator'):
|
||||
ax.yaxis.set_major_locator(ax.yaxis._orig_major_locator)
|
||||
delattr(ax.yaxis, '_orig_major_locator')
|
||||
elif isinstance(ax.yaxis.get_major_locator(), ticker.NullLocator):
|
||||
ax.yaxis.set_major_locator(ticker.AutoLocator())
|
||||
if len(yspines) == 1:
|
||||
ax.yaxis.set_ticks_position(yspines[0])
|
||||
ax.yaxis.set_label_position(yspines[0])
|
||||
else:
|
||||
ax.yaxis.set_ticks_position('both')
|
||||
ax.yaxis.set_label_position('left')
|
||||
|
||||
def plot_g(ax, df, models, i, let_x, let_y, titlesize=10, letsize=12):
|
||||
# c = [cm.plasma(x) for x in np.linspace(0., 1., 9)]
|
||||
# c = [cm.turbo(x) for x in np.linspace(0., 1., 9)]
|
||||
c = [cm.gray(x) for x in np.linspace(0., 0.75, 9)]
|
||||
myorder = [0, 4, 1, 6, 2,7, 3,8]
|
||||
colors = [c[i] for i in myorder]
|
||||
df.plot.bar(y=models[i], rot=90, ax=ax, legend=False,
|
||||
ylabel='$\mathrm{g}_{\mathrm{max}}$ [$\mathrm{mS}/ \mathrm{cm}^2$]',
|
||||
color=colors)
|
||||
ax.set_title(models[i], fontsize=titlesize)
|
||||
show_spines(ax, spines='lb')
|
||||
ax.text(let_x, let_y, string.ascii_uppercase[i], transform=ax.transAxes, size=letsize, weight='bold')
|
||||
ax.set_yscale('log')
|
||||
return ax
|
||||
|
||||
|
||||
index = ['$\mathrm{g}_{\mathrm{Na}}$', '$\mathrm{g}_{\mathrm{Kd}}$', '$\mathrm{g}_{\mathrm{K_V1.1}}$',
|
||||
'$\mathrm{g}_{\mathrm{A}}$', '$\mathrm{g}_{\mathrm{M}}$', '$\mathrm{g}_{\mathrm{L}}$',
|
||||
'$\mathrm{g}_{\mathrm{T}}$', ' $\mathrm{g}_{\mathrm{Ca,K}}$', ' $\mathrm{g}_{\mathrm{Leak}}$']
|
||||
df = pd.DataFrame({'RS Pyramidal': [56, 6, 0, 0, 0.075, 0, 0, 0, 0.0205],
|
||||
'RS Pyramidal +$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$': [56, 5.4, 0.6, 0, 0.075, 0, 0, 0, 0.0205],
|
||||
'RS Inhibitory': [10, 2.1, 0, 0, 0.0098, 0, 0, 0, 0.0205],
|
||||
'RS Inhibitory +$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$': [10, 1.89, 0.21, 0, 0.0098, 0, 0, 0, 0.0205],
|
||||
'FS': [58, 3.9, 0, 0, 0.075, 0, 0, 0, 0.038],
|
||||
'FS +$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$': [58, 3.51, 0.39, 0, 0.075, 0, 0, 0, 0.038],
|
||||
'Cb stellate': [3.4, 9.0556, 0, 15.0159, 0, 0, 0.4545, 0, 0.07407],
|
||||
'Cb stellate +$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$': [3.4, 8.15, 0.90556, 15.0159, 0, 0, 0.4545, 0, 0.07407],
|
||||
'Cb stellate $\Delta$$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$': [3.4, 9.0556, 1.50159, 0, 0, 0, 0.4545, 0, 0.07407],
|
||||
'STN': [49, 57, 0, 5, 0, 5, 5, 1, 0.035],
|
||||
'STN +$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$': [49, 56.43, 0.57, 5, 0, 5, 5, 1, 0.035],
|
||||
'STN $\Delta$$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$': [49, 57, 0.5, 0, 0, 5, 5, 1, 0.035]},
|
||||
index=index)
|
||||
|
||||
|
||||
#% with legend
|
||||
scheme_style()
|
||||
models = ['Cb stellate', 'RS Inhibitory', 'FS', 'RS Pyramidal', 'RS Inhibitory +$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$',
|
||||
'Cb stellate +$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$', 'FS +$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$',
|
||||
'RS Pyramidal +$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$', 'STN +$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$',
|
||||
'Cb stellate $\Delta$$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$',
|
||||
'STN $\Delta$$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$', 'STN']
|
||||
fig, axs = plt.subplots(4, 3, figsize=cm2inch(17.2, 20)) # , sharey=True)
|
||||
plt.subplots_adjust(hspace=1.5, wspace=1.0)
|
||||
let_x = -0.6
|
||||
let_y = 1.2
|
||||
titlesize = 9
|
||||
letsize = 10
|
||||
axs[0, 0] = plot_g(axs[0, 0], df, models, 0, let_x, let_y, titlesize=titlesize, letsize=letsize)
|
||||
axs[0, 1] = plot_g(axs[0, 1], df, models, 1, let_x, let_y, titlesize=titlesize, letsize=letsize)
|
||||
axs[0, 2] = plot_g(axs[0, 2], df, models, 2, let_x, let_y, titlesize=titlesize, letsize=letsize)
|
||||
axs[1, 0] = plot_g(axs[1, 0], df, models, 3, let_x, let_y, titlesize=titlesize, letsize=letsize)
|
||||
axs[1, 1] = plot_g(axs[1, 1], df, models, 4, let_x, let_y, titlesize=titlesize, letsize=letsize)
|
||||
axs[1, 2] = plot_g(axs[1, 2], df, models, 5, let_x, let_y, titlesize=titlesize, letsize=letsize)
|
||||
axs[2, 0] = plot_g(axs[2, 0], df, models, 6, let_x, let_y, titlesize=titlesize, letsize=letsize)
|
||||
axs[2, 1] = plot_g(axs[2, 1], df, models, 7, let_x, let_y, titlesize=titlesize, letsize=letsize)
|
||||
axs[2, 2] = plot_g(axs[2, 2], df, models, 8, let_x, let_y, titlesize=titlesize, letsize=letsize)
|
||||
axs[3, 0] = plot_g(axs[3, 0], df, models, 9, let_x, let_y, titlesize=titlesize, letsize=letsize)
|
||||
axs[3, 1] = plot_g(axs[3, 1], df, models, 10, let_x, let_y, titlesize=titlesize, letsize=letsize)
|
||||
axs[3, 2] = plot_g(axs[3, 2], df, models, 11, let_x, let_y, titlesize=titlesize, letsize=letsize)
|
||||
# save
|
||||
# fig.set_size_inches(cm2inch(21,20))
|
||||
fig.savefig('./Figures/model_g.jpg', dpi=300, bbox_inches='tight') # pdf # eps
|
||||
plt.show()
|
||||
|
||||
33493
Figures/ramp_firing.eps
Normal file
BIN
Figures/ramp_firing.jpg
Normal file
|
After Width: | Height: | Size: 525 KiB |
BIN
Figures/ramp_firing.png
Normal file
|
After Width: | Height: | Size: 102 KiB |
9839
Figures/rheobase_correlation.eps
Normal file
BIN
Figures/rheobase_correlation.jpg
Normal file
|
After Width: | Height: | Size: 424 KiB |
BIN
Figures/rheobase_correlation.png
Normal file
|
After Width: | Height: | Size: 275 KiB |
10363
Figures/simulation_model_comparison.eps
Normal file
BIN
Figures/simulation_model_comparison.jpg
Normal file
|
After Width: | Height: | Size: 436 KiB |
BIN
Figures/simulation_model_comparison.png
Normal file
|
After Width: | Height: | Size: 284 KiB |
BIN
Figures/summary_diagram2.png
Normal file
|
After Width: | Height: | Size: 870 KiB |
BIN
Figures/summary_diagram3.png
Normal file
|
After Width: | Height: | Size: 928 KiB |
BIN
Figures/summary_fig.jpg
Normal file
|
After Width: | Height: | Size: 211 KiB |
BIN
Figures/summary_fig.pdf
Normal file
@@ -6,20 +6,22 @@ from matplotlib.colors import colorConverter as cc
|
||||
from matplotlib.colors import to_hex
|
||||
import string
|
||||
from plotstyle import scheme_style
|
||||
import pandas as pd
|
||||
from matplotlib import cm
|
||||
|
||||
colorslist = ['#40A787', # cyan'#
|
||||
'#F0D730', # yellow
|
||||
'#C02717', # red
|
||||
'#007030', # dark green
|
||||
'#AAB71B', # lightgreen
|
||||
'#008797', # light blue
|
||||
'#F78017', # orange
|
||||
'#478010', # green
|
||||
'#53379B', # purple
|
||||
'#2060A7', # blue
|
||||
'#873770', # magenta
|
||||
'#D03050' # pink
|
||||
]
|
||||
colorslist = [ '#40A787', # cyan'#
|
||||
'#F0D730', # yellow
|
||||
'#C02717', # red
|
||||
'#007030', # dark green
|
||||
'#AAB71B', # lightgreen
|
||||
'#008797', # light blue
|
||||
'#F78017', # orange
|
||||
'#478010', # green
|
||||
'#53379B', # purple
|
||||
'#2060A7', # blue
|
||||
'#873770', # magenta
|
||||
'#D03050' # pink
|
||||
]
|
||||
|
||||
|
||||
def cm2inch(*tupl):
|
||||
@@ -247,22 +249,41 @@ def plot_quadrant(ax):
|
||||
b[0] = '\u2212'
|
||||
b[1] = '+'
|
||||
ax.set_yticklabels(b)
|
||||
#
|
||||
# #%%
|
||||
#
|
||||
# imgplot = plt.imshow(img)
|
||||
# plt.show()
|
||||
|
||||
def plot_g(ax, df, i):
|
||||
# c = [cm.plasma(x) for x in np.linspace(0., 1., 9)]
|
||||
# c = [cm.turbo(x) for x in np.linspace(0., 1., 9)]
|
||||
# c = [cm.gray(x) for x in np.linspace(0., 0.75, 8)]
|
||||
# myorder = [0, 4, 1, 6, 2, 7, 3]
|
||||
# colors = [c[i] for i in myorder]
|
||||
tab10 = [cm.tab10(x) for x in np.linspace(0., 1, 10)]
|
||||
Accent = [cm.Accent(x) for x in np.linspace(0., 1, 8)]
|
||||
colors = [colorslist[2], Accent[7], tab10[4], 'limegreen', tab10[5], tab10[9], tab10[1], 'fuchsia']
|
||||
df.plot.bar(y=i, rot=90, ax=ax, legend=False, color=colors, ylabel='$\mathrm{g}_{\mathrm{max}}$')
|
||||
# ax.set_title(models[i], fontsize=titlesize)
|
||||
show_spines(ax, spines='lb')
|
||||
ax.set_xticks([])
|
||||
ax.set_yticks([])
|
||||
ax.set_ylim(0, 8)
|
||||
|
||||
ax.set_xlim(-0.75, 8)
|
||||
# ax.text(let_x, let_y, string.ascii_uppercase[i], transform=ax.transAxes, size=letsize, weight='bold')
|
||||
# ax.set_yscale('log')
|
||||
return ax
|
||||
|
||||
index = ['1', '2', '3','4','5','6','7','8']
|
||||
df = pd.DataFrame({1: [6, 5.5, 2, 0, 1., 0, 6, 1.5],
|
||||
2: [8, 5, 8, 4, 0., 4, 0, 6.],
|
||||
3: [4, 4, 3, 3, 0., 1, 3, 0.]}, index=index)
|
||||
|
||||
# %% with legend
|
||||
scheme_style()
|
||||
import matplotlib.image as mpimg
|
||||
img = mpimg.imread('./Figures/summary_diagram2.png')
|
||||
img = mpimg.imread('./Figures/summary_diagram3.png')
|
||||
inset_ylim = (0, 100)
|
||||
lfsize = 8
|
||||
lfsize = 7
|
||||
fig = plt.figure(figsize=cm2inch(17.2, 12))
|
||||
gs = gridspec.GridSpec(14, 3, top=0.95, bottom=0.1, left=0.15, right=0.95, hspace=0.2, wspace=0.1)
|
||||
gs = gridspec.GridSpec(15, 3, top=0.95, bottom=0.1, left=0.15, right=0.95, hspace=0.4, wspace=0.2)
|
||||
|
||||
|
||||
# gs0 = gs[1:13, 2].subgridspec(3, 1, hspace=0.9, wspace=0.25) # width_ratios=[0.3, 0.3,0.3], height_ratios=[0.35],
|
||||
@@ -281,7 +302,15 @@ ax0 = fig.add_subplot(gs[:, :2])
|
||||
|
||||
ax0.imshow(img)
|
||||
show_spines(ax0, '')
|
||||
|
||||
axin1 = ax0.inset_axes([2200, 0, 400.0, 300], transform=ax0.transData)
|
||||
axin1 = plot_g(axin1, df, 1)
|
||||
axin2 = ax0.inset_axes([2200, 1200, 400.0, 300], transform=ax0.transData)
|
||||
axin2 = plot_g(axin2, df, 2)
|
||||
axin3 = ax0.inset_axes([2200, 2400, 400.0, 300], transform=ax0.transData)
|
||||
axin3 = plot_g(axin3, df, 3)
|
||||
# show_spines(axin1, '')
|
||||
# show_spines(axin2, '')
|
||||
# show_spines(axin3, '')
|
||||
|
||||
# ax1.text(-0.95, -0.55, 'GOF/\nLOF?', ha='right')
|
||||
plot_diff_sqrt(ax1, b2=0.06, c2=65)
|
||||
@@ -290,9 +319,11 @@ ax1.annotate('', (0.225, 7), (0.07, 7),
|
||||
arrowprops=dict(arrowstyle="<|-", color=colorslist[2], lw=0.5, mutation_scale=5), zorder=-10) #
|
||||
ax1.annotate('', (0.8, 80), (0.85, 55),
|
||||
arrowprops=dict(arrowstyle="<|-", color=colorslist[2], lw=0.5, mutation_scale=5), zorder=-10) #
|
||||
ax1.text(x=0.05, y=95, s='$\\downarrow$ AUC $\downarrow$ rheobase', fontsize=lfsize)
|
||||
|
||||
ax1.text(x=0.85, y=90, s='WT',color=colorslist[9],rotation=17.5, fontsize=lfsize, weight='bold')
|
||||
ax1.text(x=0.75, y=37.5, s='Mutant',color=colorslist[2],rotation=10, fontsize=lfsize, weight='bold')
|
||||
|
||||
# colorslist[9]
|
||||
# colorslist[2]
|
||||
|
||||
# ax2.text(0.95, 0.35, 'LOF/\nGOF?')
|
||||
plot_diff_sqrt(ax2, b2=0.4, c2=200)
|
||||
@@ -301,8 +332,10 @@ ax2.annotate('', (0.19, 7), (0.41, 7),
|
||||
arrowprops=dict(arrowstyle="<|-", color=colorslist[2], lw=0.5, mutation_scale=5), zorder=-10) #
|
||||
ax2.annotate('', (0.75, 70), (0.6, 90),
|
||||
arrowprops=dict(arrowstyle="<|-", color=colorslist[2], lw=0.5, mutation_scale=5), zorder=-10) #
|
||||
ax2.text(x=0.05, y=110, s='$\\uparrow$ AUC $\\uparrow$ rheobase', fontsize=lfsize)
|
||||
#
|
||||
# ax2.text(x=0.05, y=110, s='$\\uparrow$ AUC $\\uparrow$ rheobase', fontsize=lfsize)
|
||||
ax2.text(x=0.85, y=90, s='WT',color=colorslist[9],rotation=17.5, fontsize=lfsize, weight='bold')
|
||||
ax2.text(x=0.4, y=60, s='Mutant',color=colorslist[2],rotation=52, fontsize=lfsize, weight='bold')
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -316,12 +349,12 @@ ax3.annotate('', (0.225, 7), (0.085, 7),
|
||||
arrowprops=dict(arrowstyle="<|-", color=colorslist[2], lw=0.5, mutation_scale=5), zorder=-10) #
|
||||
ax3.annotate('', (0.55, 55), (0.3, 90),
|
||||
arrowprops=dict(arrowstyle="<|-", color=colorslist[2], lw=0.5, mutation_scale=5), zorder=-10) #
|
||||
ax3.text(x=0.05, y=110, s='$\\uparrow$ AUC $\\downarrow$ rheobase', fontsize=lfsize)
|
||||
# ax3.text(x=0.05, y=110, s='$\\uparrow$ AUC $\\downarrow$ rheobase', fontsize=lfsize)
|
||||
ax3.text(x=0.85, y=90, s='WT',color=colorslist[9],rotation=17.5, fontsize=lfsize, weight='bold')
|
||||
ax3.text(x=0.09, y=60, s='Mutant',color=colorslist[2],rotation=53, fontsize=lfsize, weight='bold')
|
||||
|
||||
# fig.set_size_inches(cm2inch(17, 12))
|
||||
# fig.savefig('./Figures/summary_fig.jpg', dpi=300, bbox_inches='tight') # , dpi=fig.dpi #pdf #eps
|
||||
#
|
||||
|
||||
fig.savefig('./Figures/summary_fig.jpg', dpi=300, bbox_inches='tight') # , dpi=fig.dpi #pdf #eps
|
||||
plt.show()
|
||||
|
||||
|
||||
|
||||